<!doctype html><html lang="en">
 <head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <title>WebXR Hit Test Module</title>
  <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
<style data-fill-with="stylesheet">/******************************************************************************
 *                   Style sheet for the W3C specifications                   *
 *
 * Special classes handled by this style sheet include:
 *
 * Indices
 *   - .toc for the Table of Contents (<ol class="toc">)
 *     + <span class="secno"> for the section numbers
 *   - #toc for the Table of Contents (<nav id="toc">)
 *   - ul.index for Indices (<a href="#ref">term</a><span>, in §N.M</span>)
 *   - table.index for Index Tables (e.g. for properties or elements)
 *
 * Structural Markup
 *   - table.data for general data tables
 *     -> use 'scope' attribute, <colgroup>, <thead>, and <tbody> for best results !
 *     -> use <table class='complex data'> for extra-complex tables
 *     -> use <td class='long'> for paragraph-length cell content
 *     -> use <td class='pre'> when manual line breaks/indentation would help readability
 *   - dl.switch for switch statements
 *   - ol.algorithm for algorithms (helps to visualize nesting)
 *   - .figure and .caption (HTML4) and figure and figcaption (HTML5)
 *     -> .sidefigure for right-floated figures
 *   - ins/del
 *
 * Code
 *   - pre and code
 *
 * Special Sections
 *   - .note       for informative notes             (div, p, span, aside, details)
 *   - .example    for informative examples          (div, p, pre, span)
 *   - .issue      for issues                        (div, p, span)
 *   - .assertion  for assertions                    (div, p, span)
 *   - .advisement for loud normative statements     (div, p, strong)
 *   - .annoying-warning for spec obsoletion notices (div, aside, details)
 *
 * Definition Boxes
 *   - pre.def   for WebIDL definitions
 *   - table.def for tables that define other entities (e.g. CSS properties)
 *   - dl.def    for definition lists that define other entitles (e.g. HTML elements)
 *
 * Numbering
 *   - .secno for section numbers in .toc and headings (<span class='secno'>3.2</span>)
 *   - .marker for source-inserted example/figure/issue numbers (<span class='marker'>Issue 4</span>)
 *   - ::before styled for CSS-generated issue/example/figure numbers:
 *     -> Documents wishing to use this only need to add
 *        figcaption::before,
 *        .caption::before { content: "Figure "  counter(figure) " ";  }
 *        .example::before { content: "Example " counter(example) " "; }
 *        .issue::before   { content: "Issue "   counter(issue) " ";   }
 *
 * Header Stuff (ignore, just don't conflict with these classes)
 *   - .head for the header
 *   - .copyright for the copyright
 *
 * Miscellaneous
 *   - .overlarge for things that should be as wide as possible, even if
 *     that overflows the body text area. This can be used on an item or
 *     on its container, depending on the effect desired.
 *     Note that this styling basically doesn't help at all when printing,
 *     since A4 paper isn't much wider than the max-width here.
 *     It's better to design things to fit into a narrower measure if possible.
 *   - js-added ToC jump links (see fixup.js)
 *
 ******************************************************************************/

/******************************************************************************/
/*                                   Body                                     */
/******************************************************************************/

	body {
		counter-reset: example figure issue;

		/* Layout */
		max-width: 50em;               /* limit line length to 50em for readability   */
		margin: 0 auto;                /* center text within page                     */
		padding: 1.6em 1.5em 2em 50px; /* assume 16px font size for downlevel clients */
		padding: 1.6em 1.5em 2em calc(26px + 1.5em); /* leave space for status flag     */

		/* Typography */
		line-height: 1.5;
		font-family: sans-serif;
		widows: 2;
		orphans: 2;
		word-wrap: break-word;
		overflow-wrap: break-word;
		hyphens: auto;

		/* Colors */
		color: black;
		background: white top left fixed no-repeat;
		background-size: 25px auto;
	}


/******************************************************************************/
/*                         Front Matter & Navigation                          */
/******************************************************************************/

/** Header ********************************************************************/

	div.head { margin-bottom: 1em }
	div.head hr { border-style: solid; }

	div.head h1 {
		font-weight: bold;
		margin: 0 0 .1em;
		font-size: 220%;
	}

	div.head h2 { margin-bottom: 1.5em;}

/** W3C Logo ******************************************************************/

	.head .logo {
		float: right;
		margin: 0.4rem 0 0.2rem .4rem;
	}

	.head img[src*="logos/W3C"] {
		display: block;
		border: solid #1a5e9a;
		border-width: .65rem .7rem .6rem;
		border-radius: .4rem;
		background: #1a5e9a;
		color: white;
		font-weight: bold;
	}

	.head a:hover > img[src*="logos/W3C"],
	.head a:focus > img[src*="logos/W3C"] {
		opacity: .8;
	}

	.head a:active > img[src*="logos/W3C"] {
		background: #c00;
		border-color: #c00;
	}

	/* see also additional rules in Link Styling section */

/** Copyright *****************************************************************/

	p.copyright,
	p.copyright small { font-size: small }

/** Back to Top / ToC Toggle **************************************************/

	@media print {
		#toc-nav {
			display: none;
		}
	}
	@media not print {
		#toc-nav {
			position: fixed;
			z-index: 2;
			bottom: 0; left: 0;
			margin: 0;
			min-width: 1.33em;
			border-top-right-radius: 2rem;
			box-shadow: 0 0 2px;
			font-size: 1.5em;
			color: black;
		}
		#toc-nav > a {
			display: block;
			white-space: nowrap;

			height: 1.33em;
			padding: .1em 0.3em;
			margin: 0;

			background: white;
			box-shadow: 0 0 2px;
			border: none;
			border-top-right-radius: 1.33em;
			background: white;
		}
		#toc-nav > #toc-jump {
			padding-bottom: 2em;
			margin-bottom: -1.9em;
		}

		#toc-nav > a:hover,
		#toc-nav > a:focus {
			background: #f8f8f8;
		}
		#toc-nav > a:not(:hover):not(:focus) {
			color: #707070;
		}

		/* statusbar gets in the way on keyboard focus; remove once browsers fix */
		#toc-nav > a[href="#toc"]:not(:hover):focus:last-child {
			padding-bottom: 1.5rem;
		}

		#toc-nav:not(:hover) > a:not(:focus) > span + span {
			/* Ideally this uses :focus-within on #toc-nav */
			display: none;
		}
		#toc-nav > a > span + span {
			padding-right: 0.2em;
		}

		#toc-toggle-inline {
			vertical-align: 0.05em;
			font-size: 80%;
			color: gray;
			color: hsla(203,20%,40%,.7);
			border-style: none;
			background: transparent;
			position: relative;
		}
		#toc-toggle-inline:hover:not(:active),
		#toc-toggle-inline:focus:not(:active) {
			text-shadow: 1px 1px silver;
			top: -1px;
			left: -1px;
		}

		#toc-nav :active {
			color: #C00;
		}
	}

/** ToC Sidebar ***************************************************************/

	/* Floating sidebar */
	@media screen {
		body.toc-sidebar #toc {
			position: fixed;
			top: 0; bottom: 0;
			left: 0;
			width: 23.5em;
			max-width: 80%;
			max-width: calc(100% - 2em - 26px);
			overflow: auto;
			padding: 0 1em;
			padding-left: 42px;
			padding-left: calc(1em + 26px);
			background: inherit;
			background-color: #f7f8f9;
			z-index: 1;
			box-shadow: -.1em 0 .25em rgba(0,0,0,.1) inset;
		}
		body.toc-sidebar #toc h2 {
			margin-top: .8rem;
			font-variant: small-caps;
			font-variant: all-small-caps;
			text-transform: lowercase;
			font-weight: bold;
			color: gray;
			color: hsla(203,20%,40%,.7);
		}
		body.toc-sidebar #toc-jump:not(:focus) {
			width: 0;
			height: 0;
			padding: 0;
			position: absolute;
			overflow: hidden;
		}
	}
	/* Hide main scroller when only the ToC is visible anyway */
	@media screen and (max-width: 28em) {
		body.toc-sidebar {
			overflow: hidden;
		}
	}

	/* Sidebar with its own space */
	@media screen and (min-width: 78em) {
		body:not(.toc-inline) #toc {
			position: fixed;
			top: 0; bottom: 0;
			left: 0;
			width: 23.5em;
			overflow: auto;
			padding: 0 1em;
			padding-left: 42px;
			padding-left: calc(1em + 26px);
			background: inherit;
			background-color: #f7f8f9;
			z-index: 1;
			box-shadow: -.1em 0 .25em rgba(0,0,0,.1) inset;
		}
		body:not(.toc-inline) #toc h2 {
			margin-top: .8rem;
			font-variant: small-caps;
			font-variant: all-small-caps;
			text-transform: lowercase;
			font-weight: bold;
			color: gray;
			color: hsla(203,20%,40%,.7);
		}

		body:not(.toc-inline) {
			padding-left: 29em;
		}
		/* See also Overflow section at the bottom */

		body:not(.toc-inline) #toc-jump:not(:focus) {
			width: 0;
			height: 0;
			padding: 0;
			position: absolute;
			overflow: hidden;
		}
	}
	@media screen and (min-width: 90em) {
		body:not(.toc-inline) {
			margin: 0 4em;
		}
	}

/******************************************************************************/
/*                                Sectioning                                  */
/******************************************************************************/

/** Headings ******************************************************************/

	h1, h2, h3, h4, h5, h6, dt {
		page-break-after: avoid;
		page-break-inside: avoid;
		font: 100% sans-serif;   /* Reset all font styling to clear out UA styles */
		font-family: inherit;    /* Inherit the font family. */
		line-height: 1.2;        /* Keep wrapped headings compact */
		hyphens: manual;         /* Hyphenated headings look weird */
	}

	h2, h3, h4, h5, h6 {
		margin-top: 3rem;
	}

	h1, h2, h3 {
		color: #005A9C;
		background: transparent;
	}

	h1 { font-size: 170%; }
	h2 { font-size: 140%; }
	h3 { font-size: 120%; }
	h4 { font-weight: bold; }
	h5 { font-style: italic; }
	h6 { font-variant: small-caps; }
	dt { font-weight: bold; }

/** Subheadings ***************************************************************/

	h1 + h2,
	#subtitle {
		/* #subtitle is a subtitle in an H2 under the H1 */
		margin-top: 0;
	}
	h2 + h3,
	h3 + h4,
	h4 + h5,
	h5 + h6 {
		margin-top: 1.2em; /* = 1 x line-height */
	}

/** Section divider ***********************************************************/

	:not(.head) > hr {
		font-size: 1.5em;
		text-align: center;
		margin: 1em auto;
		height: auto;
		border: transparent solid 0;
		background: transparent;
	}
	:not(.head) > hr::before {
		content: "\2727\2003\2003\2727\2003\2003\2727";
	}

/******************************************************************************/
/*                            Paragraphs and Lists                            */
/******************************************************************************/

	p {
		margin: 1em 0;
	}

	dd > p:first-child,
	li > p:first-child {
		margin-top: 0;
	}

	ul, ol {
		margin-left: 0;
		padding-left: 2em;
	}

	li {
		margin: 0.25em 0 0.5em;
		padding: 0;
	}

	dl dd {
		margin: 0 0 .5em 2em;
	}

	.head dd + dd { /* compact for header */
		margin-top: -.5em;
	}

	/* Style for algorithms */
	ol.algorithm ol:not(.algorithm),
	.algorithm > ol ol:not(.algorithm) {
	 border-left: 0.5em solid #DEF;
	}

	/* Put nice boxes around each algorithm. */
	[data-algorithm]:not(.heading) {
	  padding: .5em;
	  border: thin solid #ddd; border-radius: .5em;
	  margin: .5em calc(-0.5em - 1px);
	}
	[data-algorithm]:not(.heading) > :first-child {
	  margin-top: 0;
	}
	[data-algorithm]:not(.heading) > :last-child {
	  margin-bottom: 0;
	}

	/* Style for switch/case <dl>s */
	dl.switch > dd > ol.only,
	dl.switch > dd > .only > ol {
	 margin-left: 0;
	}
	dl.switch > dd > ol.algorithm,
	dl.switch > dd > .algorithm > ol {
	 margin-left: -2em;
	}
	dl.switch {
	 padding-left: 2em;
	}
	dl.switch > dt {
	 text-indent: -1.5em;
	 margin-top: 1em;
	}
	dl.switch > dt + dt {
	 margin-top: 0;
	}
	dl.switch > dt::before {
	 content: '\21AA';
	 padding: 0 0.5em 0 0;
	 display: inline-block;
	 width: 1em;
	 text-align: right;
	 line-height: 0.5em;
	}

/** Terminology Markup ********************************************************/


/******************************************************************************/
/*                                 Inline Markup                              */
/******************************************************************************/

/** Terminology Markup ********************************************************/
	dfn   { /* Defining instance */
		font-weight: bolder;
	}
	a > i { /* Instance of term */
		font-style: normal;
	}
	dt dfn code, code.idl {
		font-size: medium;
	}
	dfn var {
		font-style: normal;
	}

/** Change Marking ************************************************************/

	del { color: red;  text-decoration: line-through; }
	ins { color: #080; text-decoration: underline;    }

/** Miscellaneous improvements to inline formatting ***************************/

	sup {
		vertical-align: super;
		font-size: 80%
	}

/******************************************************************************/
/*                                    Code                                    */
/******************************************************************************/

/** General monospace/pre rules ***********************************************/

	pre, code, samp {
		font-family: Menlo, Consolas, "DejaVu Sans Mono", Monaco, monospace;
		font-size: .9em;
		page-break-inside: avoid;
		hyphens: none;
		text-transform: none;
	}
	pre code,
	code code {
		font-size: 100%;
	}

	pre {
		margin-top: 1em;
		margin-bottom: 1em;
		overflow: auto;
	}

/** Inline Code fragments *****************************************************/

  /* Do something nice. */

/******************************************************************************/
/*                                    Links                                   */
/******************************************************************************/

/** General Hyperlinks ********************************************************/

	/* We hyperlink a lot, so make it less intrusive */
	a[href] {
		color: #034575;
		text-decoration: none;
		border-bottom: 1px solid #707070;
		/* Need a bit of extending for it to look okay */
		padding: 0 1px 0;
		margin: 0 -1px 0;
	}
	a:visited {
		border-bottom-color: #BBB;
	}

	/* Use distinguishing colors when user is interacting with the link */
	a[href]:focus,
	a[href]:hover {
		background: #f8f8f8;
		background: rgba(75%, 75%, 75%, .25);
		border-bottom-width: 3px;
		margin-bottom: -2px;
	}
	a[href]:active {
		color: #C00;
		border-color: #C00;
	}

	/* Backout above styling for W3C logo */
	.head .logo,
	.head .logo a {
		border: none;
		text-decoration: none;
		background: transparent;
	}

/******************************************************************************/
/*                                    Images                                  */
/******************************************************************************/

	img {
		border-style: none;
	}

	/* For autogen numbers, add
	   .caption::before, figcaption::before { content: "Figure " counter(figure) ". "; }
	*/

	figure, .figure, .sidefigure {
		page-break-inside: avoid;
		text-align: center;
		margin: 2.5em 0;
	}
	.figure img,    .sidefigure img,    figure img,
	.figure object, .sidefigure object, figure object {
		max-width: 100%;
		margin: auto;
	}
	.figure pre, .sidefigure pre, figure pre {
		text-align: left;
		display: table;
		margin: 1em auto;
	}
	.figure table, figure table {
		margin: auto;
	}
	@media screen and (min-width: 20em) {
		.sidefigure {
			float: right;
			width: 50%;
			margin: 0 0 0.5em 0.5em
		}
	}
	.caption, figcaption, caption {
		font-style: italic;
		font-size: 90%;
	}
	.caption::before, figcaption::before, figcaption > .marker {
		font-weight: bold;
	}
	.caption, figcaption {
		counter-increment: figure;
	}

	/* DL list is indented 2em, but figure inside it is not */
	dd > .figure, dd > figure { margin-left: -2em }

/******************************************************************************/
/*                             Colored Boxes                                  */
/******************************************************************************/

	.issue, .note, .example, .assertion, .advisement, blockquote {
		padding: .5em;
		border: .5em;
		border-left-style: solid;
		page-break-inside: avoid;
	}
	span.issue, span.note {
		padding: .1em .5em .15em;
		border-right-style: solid;
	}

	.issue,
	.note,
	.example,
	.advisement,
	.assertion,
	blockquote {
		margin: 1em auto;
	}
	.note  > p:first-child,
	.issue > p:first-child,
	blockquote > :first-child {
		margin-top: 0;
	}
	blockquote > :last-child {
		margin-bottom: 0;
	}

/** Blockquotes ***************************************************************/

	blockquote {
		border-color: silver;
	}

/** Open issue ****************************************************************/

	.issue {
		border-color: #E05252;
		background: #FBE9E9;
		counter-increment: issue;
		overflow: auto;
	}
	.issue::before, .issue > .marker {
		text-transform: uppercase;
		color: #AE1E1E;
		padding-right: 1em;
		text-transform: uppercase;
	}
	/* Add .issue::before { content: "Issue " counter(issue) " "; } for autogen numbers,
	   or use class="marker" to mark up the issue number in source. */

/** Example *******************************************************************/

	.example {
		border-color: #E0CB52;
		background: #FCFAEE;
		counter-increment: example;
		overflow: auto;
		clear: both;
	}
	.example::before, .example > .marker {
		text-transform: uppercase;
		color: #827017;
		min-width: 7.5em;
		display: block;
	}
	/* Add .example::before { content: "Example " counter(example) " "; } for autogen numbers,
	   or use class="marker" to mark up the example number in source. */

/** Non-normative Note ********************************************************/

	.note {
		border-color: #52E052;
		background: #E9FBE9;
		overflow: auto;
	}

	.note::before, .note > .marker,
	details.note > summary::before,
	details.note > summary > .marker {
		text-transform: uppercase;
		display: block;
		color: hsl(120, 70%, 30%);
	}
	/* Add .note::before { content: "Note"; } for autogen label,
	   or use class="marker" to mark up the label in source. */

	details.note > summary {
		display: block;
		color: hsl(120, 70%, 30%);
	}
	details.note[open] > summary {
		border-bottom: 1px silver solid;
	}

/** Assertion Box *************************************************************/
	/*  for assertions in algorithms */

	.assertion {
		border-color: #AAA;
		background: #EEE;
	}

/** Advisement Box ************************************************************/
	/*  for attention-grabbing normative statements */

	.advisement {
		border-color: orange;
		border-style: none solid;
		background: #FFEECC;
	}
	strong.advisement {
		display: block;
		text-align: center;
	}
	.advisement > .marker {
		color: #B35F00;
	}

/** Spec Obsoletion Notice ****************************************************/
	/* obnoxious obsoletion notice for older/abandoned specs. */

	details {
		display: block;
	}
	summary {
		font-weight: bolder;
	}

	.annoying-warning:not(details),
	details.annoying-warning:not([open]) > summary,
	details.annoying-warning[open] {
		background: #fdd;
		color: red;
		font-weight: bold;
		padding: .75em 1em;
		border: thick red;
		border-style: solid;
		border-radius: 1em;
	}
	.annoying-warning :last-child {
		margin-bottom: 0;
	}

@media not print {
	details.annoying-warning[open] {
		position: fixed;
		left: 1em;
		right: 1em;
		bottom: 1em;
		z-index: 1000;
	}
}

	details.annoying-warning:not([open]) > summary {
		text-align: center;
	}

/** Entity Definition Boxes ***************************************************/

	.def {
		padding: .5em 1em;
		background: #DEF;
		margin: 1.2em 0;
		border-left: 0.5em solid #8CCBF2;
	}

/******************************************************************************/
/*                                    Tables                                  */
/******************************************************************************/

	th, td {
		text-align: left;
		text-align: start;
	}

/** Property/Descriptor Definition Tables *************************************/

	table.def {
		/* inherits .def box styling, see above */
		width: 100%;
		border-spacing: 0;
	}

	table.def td,
	table.def th {
		padding: 0.5em;
		vertical-align: baseline;
		border-bottom: 1px solid #bbd7e9;
	}

	table.def > tbody > tr:last-child th,
	table.def > tbody > tr:last-child td {
		border-bottom: 0;
	}

	table.def th {
		font-style: italic;
		font-weight: normal;
		padding-left: 1em;
		width: 3em;
	}

	/* For when values are extra-complex and need formatting for readability */
	table td.pre {
		white-space: pre-wrap;
	}

	/* A footnote at the bottom of a def table */
	table.def           td.footnote {
		padding-top: 0.6em;
	}
	table.def           td.footnote::before {
		content: " ";
		display: block;
		height: 0.6em;
		width: 4em;
		border-top: thin solid;
	}

/** Data tables (and properly marked-up index tables) *************************/
	/*
		 <table class="data"> highlights structural relationships in a table
		 when correct markup is used (e.g. thead/tbody, th vs. td, scope attribute)

		 Use class="complex data" for particularly complicated tables --
		 (This will draw more lines: busier, but clearer.)

		 Use class="long" on table cells with paragraph-like contents
		 (This will adjust text alignment accordingly.)
		 Alternately use class="longlastcol" on tables, to have the last column assume "long".
	*/

	table {
		word-wrap: normal;
		overflow-wrap: normal;
		hyphens: manual;
	}

	table.data,
	table.index {
		margin: 1em auto;
		border-collapse: collapse;
		border: hidden;
		width: 100%;
	}
	table.data caption,
	table.index caption {
		max-width: 50em;
		margin: 0 auto 1em;
	}

	table.data td,  table.data th,
	table.index td, table.index th {
		padding: 0.5em 1em;
		border-width: 1px;
		border-color: silver;
		border-top-style: solid;
	}

	table.data thead td:empty {
		padding: 0;
		border: 0;
	}

	table.data  thead,
	table.index thead,
	table.data  tbody,
	table.index tbody {
		border-bottom: 2px solid;
	}

	table.data colgroup,
	table.index colgroup {
		border-left: 2px solid;
	}

	table.data  tbody th:first-child,
	table.index tbody th:first-child  {
		border-right: 2px solid;
		border-top: 1px solid silver;
		padding-right: 1em;
	}

	table.data th[colspan],
	table.data td[colspan] {
		text-align: center;
	}

	table.complex.data th,
	table.complex.data td {
		border: 1px solid silver;
		text-align: center;
	}

	table.data.longlastcol td:last-child,
	table.data td.long {
	 vertical-align: baseline;
	 text-align: left;
	}

	table.data img {
		vertical-align: middle;
	}


/*
Alternate table alignment rules

	table.data,
	table.index {
		text-align: center;
	}

	table.data  thead th[scope="row"],
	table.index thead th[scope="row"] {
		text-align: right;
	}

	table.data  tbody th:first-child,
	table.index tbody th:first-child  {
		text-align: right;
	}

Possible extra rowspan handling

	table.data  tbody th[rowspan]:not([rowspan='1']),
	table.index tbody th[rowspan]:not([rowspan='1']),
	table.data  tbody td[rowspan]:not([rowspan='1']),
	table.index tbody td[rowspan]:not([rowspan='1']) {
		border-left: 1px solid silver;
	}

	table.data  tbody th[rowspan]:first-child,
	table.index tbody th[rowspan]:first-child,
	table.data  tbody td[rowspan]:first-child,
	table.index tbody td[rowspan]:first-child{
		border-left: 0;
		border-right: 1px solid silver;
	}
*/

/******************************************************************************/
/*                                  Indices                                   */
/******************************************************************************/


/** Table of Contents *********************************************************/

	.toc a {
		/* More spacing; use padding to make it part of the click target. */
		padding-top: 0.1rem;
		/* Larger, more consistently-sized click target */
		display: block;
		/* Reverse color scheme */
		color: black;
		border-color: #3980B5;
		border-bottom-width: 3px !important;
		margin-bottom: 0px !important;
	}
	.toc a:visited {
		border-color: #054572;
	}
	.toc a:not(:focus):not(:hover) {
		/* Allow colors to cascade through from link styling */
		border-bottom-color: transparent;
	}

	.toc, .toc ol, .toc ul, .toc li {
		list-style: none; /* Numbers must be inlined into source */
		/* because generated content isn't search/selectable and markers can't do multilevel yet */
		margin:  0;
		padding: 0;
		line-height: 1.1rem; /* consistent spacing */
	}

	/* ToC not indented until third level, but font style & margins show hierarchy */
	.toc > li             { font-weight: bold;   }
	.toc > li li          { font-weight: normal; }
	.toc > li li li       { font-size:   95%;    }
	.toc > li li li li    { font-size:   90%;    }
	.toc > li li li li .secno { font-size: 85%; }
	.toc > li li li li li { font-size:   85%;    }
	.toc > li li li li li .secno { font-size: 100%; }

	/* @supports not (display:grid) { */
		.toc > li             { margin: 1.5rem 0;    }
		.toc > li li          { margin: 0.3rem 0;    }
		.toc > li li li       { margin-left: 2rem;   }

		/* Section numbers in a column of their own */
		.toc .secno {
			float: left;
			width: 4rem;
			white-space: nowrap;
		}

		.toc li {
			clear: both;
		}

		:not(li) > .toc              { margin-left:  5rem; }
		.toc .secno                  { margin-left: -5rem; }
		.toc > li li li .secno       { margin-left: -7rem; }
		.toc > li li li li .secno    { margin-left: -9rem; }
		.toc > li li li li li .secno { margin-left: -11rem; }

		/* Tighten up indentation in narrow ToCs */
		@media (max-width: 30em) {
			:not(li) > .toc              { margin-left:  4rem; }
			.toc .secno                  { margin-left: -4rem; }
			.toc > li li li              { margin-left:  1rem; }
			.toc > li li li .secno       { margin-left: -5rem; }
			.toc > li li li li .secno    { margin-left: -6rem; }
			.toc > li li li li li .secno { margin-left: -7rem; }
		}
	/* } */

	@supports (display:grid) and (display:contents) {
		/* Use #toc over .toc to override non-@supports rules. */
		#toc {
			display: grid;
			align-content: start;
			grid-template-columns: auto 1fr;
			grid-column-gap: 1rem;
			column-gap: 1rem;
			grid-row-gap: .6rem;
			row-gap: .6rem;
		}
		#toc h2 {
			grid-column: 1 / -1;
			margin-bottom: 0;
		}
		#toc ol,
		#toc li,
		#toc a {
			display: contents;
			/* Switch <a> to subgrid when supported */
		}
		#toc span {
			margin: 0;
		}
		#toc > .toc > li > a > span {
			/* The spans of the top-level list,
			   comprising the first items of each top-level section. */
			margin-top: 1.1rem;
		}
		#toc#toc .secno { /* Ugh, need more specificity to override base.css */
			grid-column: 1;
			width: auto;
			margin-left: 0;
		}
		#toc .content {
			grid-column: 2;
			width: auto;
			margin-right: 1rem;
		}
		#toc .content:hover {
			background: rgba(75%, 75%, 75%, .25);
			border-bottom: 3px solid #054572;
			margin-bottom: -3px;
		}
		#toc li li li .content {
			margin-left: 1rem;
		}
		#toc li li li li .content {
			margin-left: 2rem;
		}
	}


/** Index *********************************************************************/

	/* Index Lists: Layout */
	ul.index       { margin-left: 0; columns: 15em; text-indent: 1em hanging; }
	ul.index li    { margin-left: 0; list-style: none; break-inside: avoid; }
	ul.index li li { margin-left: 1em }
	ul.index dl    { margin-top: 0; }
	ul.index dt    { margin: .2em 0 .2em 20px;}
	ul.index dd    { margin: .2em 0 .2em 40px;}
	/* Index Lists: Typography */
	ul.index ul,
	ul.index dl { font-size: smaller; }
	@media not print {
		ul.index li span {
			white-space: nowrap;
			color: transparent; }
		ul.index li a:hover + span,
		ul.index li a:focus + span {
			color: #707070;
		}
	}

/** Index Tables *****************************************************/
	/* See also the data table styling section, which this effectively subclasses */

	table.index {
		font-size: small;
		border-collapse: collapse;
		border-spacing: 0;
		text-align: left;
		margin: 1em 0;
	}

	table.index td,
	table.index th {
		padding: 0.4em;
	}

	table.index tr:hover td:not([rowspan]),
	table.index tr:hover th:not([rowspan]) {
		background: #f7f8f9;
	}

	/* The link in the first column in the property table (formerly a TD) */
	table.index th:first-child a {
		font-weight: bold;
	}

/******************************************************************************/
/*                                    Print                                   */
/******************************************************************************/

	@media print {
		/* Pages have their own margins. */
		html {
			margin: 0;
		}
		/* Serif for print. */
		body {
			font-family: serif;
		}
	}
	@page {
		margin: 1.5cm 1.1cm;
	}

/******************************************************************************/
/*                                    Legacy                                  */
/******************************************************************************/

	/* This rule is inherited from past style sheets. No idea what it's for. */
	.hide { display: none }



/******************************************************************************/
/*                             Overflow Control                               */
/******************************************************************************/

	.figure .caption, .sidefigure .caption, figcaption {
		/* in case figure is overlarge, limit caption to 50em */
		max-width: 50rem;
		margin-left: auto;
		margin-right: auto;
	}
	.overlarge {
		/* Magic to create good table positioning:
		   "content column" is 50ems wide at max; less on smaller screens.
		   Extra space (after ToC + content) is empty on the right.

		   1. When table < content column, centers table in column.
		   2. When content < table < available, left-aligns.
		   3. When table > available, fills available + scroll bar.
		*/ 
		display: grid;
		grid-template-columns: minmax(0, 50em);
	}
	.overlarge > table {
		/* limit preferred width of table */
		max-width: 50em;
		margin-left: auto;
		margin-right: auto;
	}

	@media (min-width: 55em) {
		.overlarge {
			margin-right: calc(13px + 26.5rem - 50vw);
			max-width: none;
		}
	}
	@media screen and (min-width: 78em) {
		body:not(.toc-inline) .overlarge {
			/* 30.5em body padding 50em content area */
			margin-right: calc(40em - 50vw) !important;
		}
	}
	@media screen and (min-width: 90em) {
		body:not(.toc-inline) .overlarge {
			/* 4em html margin 30.5em body padding 50em content area */
			margin-right: calc(84.5em - 100vw) !important;
		}
	}

	@media not print {
		.overlarge {
			overflow-x: auto;
			/* See Lea Verou's explanation background-attachment:
			 * http://lea.verou.me/2012/04/background-attachment-local/
			 *
			background: top left  / 4em 100% linear-gradient(to right,  #ffffff, rgba(255, 255, 255, 0)) local,
			            top right / 4em 100% linear-gradient(to left, #ffffff, rgba(255, 255, 255, 0)) local,
			            top left  / 1em 100% linear-gradient(to right,  #c3c3c5, rgba(195, 195, 197, 0)) scroll,
			            top right / 1em 100% linear-gradient(to left, #c3c3c5, rgba(195, 195, 197, 0)) scroll,
			            white;
			background-repeat: no-repeat;
			*/
		}
	}
</style>
  <link href="https://immersive-web.github.io/hit-test/" rel="canonical">
  <link href="favicon-32x32.png" rel="icon" sizes="32x32" type="image/png">
  <link href="favicon-96x96.png" rel="icon" sizes="96x96" type="image/png">
<style>
  .non-normative::before {
    content: "This section is non-normative.";
    font-style: italic;
  }
  .tg {
    border-collapse: collapse;
    border-spacing: 0;
  }
  .tg th {
    border-style: solid;
    border-width: 1px;
    background: #90b8de;
    color: #fff;
    font-family: sans-serif;
    font-weight: bold;
    border-color: grey;
  }
  .tg td {
    padding: 4px 5px;
    background-color: rgb(221, 238, 255);
    font-family: monospace;
    border-style: solid;
    border-width: 1px;
    border-color: grey;
    overflow: hidden;
    word-break: normal;
  }
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
   regarding paragraph and lists. */
[data-md] > :first-child {
    margin-top: 0;
}
[data-md] > :last-child {
    margin-bottom: 0;
}</style>
<style>/* style-selflinks */

.heading, .issue, .note, .example, li, dt {
    position: relative;
}
a.self-link {
    position: absolute;
    top: 0;
    left: calc(-1 * (3.5rem - 26px));
    width: calc(3.5rem - 26px);
    height: 2em;
    text-align: center;
    border: none;
    transition: opacity .2s;
    opacity: .5;
}
a.self-link:hover {
    opacity: 1;
}
.heading > a.self-link {
    font-size: 83%;
}
li > a.self-link {
    left: calc(-1 * (3.5rem - 26px) - 2em);
}
dfn > a.self-link {
    top: auto;
    left: auto;
    opacity: 0;
    width: 1.5em;
    height: 1.5em;
    background: gray;
    color: white;
    font-style: normal;
    transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
    opacity: 1;
}
dfn > a.self-link:hover {
    color: black;
}

a.self-link::before            { content: "¶"; }
.heading > a.self-link::before { content: "§"; }
dfn > a.self-link::before      { content: "#"; }</style>
<style>/* style-counters */

body {
    counter-reset: example figure issue;
}
.issue {
    counter-increment: issue;
}
.issue:not(.no-marker)::before {
    content: "Issue " counter(issue);
}

.example {
    counter-increment: example;
}
.example:not(.no-marker)::before {
    content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
    content: "Invalid Example" counter(example);
}

figcaption {
    counter-increment: figure;
}
figcaption:not(.no-marker)::before {
    content: "Figure " counter(figure) " ";
}</style>
<style>/* style-var-click-highlighting */

    var { cursor: pointer; }
    var.selected0 { background-color: #F4D200; box-shadow: 0 0 0 2px #F4D200; }
    var.selected1 { background-color: #FF87A2; box-shadow: 0 0 0 2px #FF87A2; }
    var.selected2 { background-color: #96E885; box-shadow: 0 0 0 2px #96E885; }
    var.selected3 { background-color: #3EEED2; box-shadow: 0 0 0 2px #3EEED2; }
    var.selected4 { background-color: #EACFB6; box-shadow: 0 0 0 2px #EACFB6; }
    var.selected5 { background-color: #82DDFF; box-shadow: 0 0 0 2px #82DDFF; }
    var.selected6 { background-color: #FFBCF2; box-shadow: 0 0 0 2px #FFBCF2; }
    </style>
<style>/* style-autolinks */

.css.css, .property.property, .descriptor.descriptor {
    color: #005a9c;
    font-size: inherit;
    font-family: inherit;
}
.css::before, .property::before, .descriptor::before {
    content: "‘";
}
.css::after, .property::after, .descriptor::after {
    content: "’";
}
.property, .descriptor {
    /* Don't wrap property and descriptor names */
    white-space: nowrap;
}
.type { /* CSS value <type> */
    font-style: italic;
}
pre .property::before, pre .property::after {
    content: "";
}
[data-link-type="property"]::before,
[data-link-type="propdesc"]::before,
[data-link-type="descriptor"]::before,
[data-link-type="value"]::before,
[data-link-type="function"]::before,
[data-link-type="at-rule"]::before,
[data-link-type="selector"]::before,
[data-link-type="maybe"]::before {
    content: "‘";
}
[data-link-type="property"]::after,
[data-link-type="propdesc"]::after,
[data-link-type="descriptor"]::after,
[data-link-type="value"]::after,
[data-link-type="function"]::after,
[data-link-type="at-rule"]::after,
[data-link-type="selector"]::after,
[data-link-type="maybe"]::after {
    content: "’";
}

[data-link-type].production::before,
[data-link-type].production::after,
.prod [data-link-type]::before,
.prod [data-link-type]::after {
    content: "";
}

[data-link-type=element],
[data-link-type=element-attr] {
    font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: .9em;
}
[data-link-type=element]::before { content: "<" }
[data-link-type=element]::after  { content: ">" }

[data-link-type=biblio] {
    white-space: pre;
}</style>
<style>/* style-dfn-panel */

.dfn-panel {
    position: absolute;
    z-index: 35;
    height: auto;
    width: -webkit-fit-content;
    width: fit-content;
    max-width: 300px;
    max-height: 500px;
    overflow: auto;
    padding: 0.5em 0.75em;
    font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
    background: #DDDDDD;
    color: black;
    border: outset 0.2em;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: black; }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel ul { padding: 0; }
.dfn-panel li { list-style: inside; }
.dfn-panel.activated {
    display: inline-block;
    position: fixed;
    left: .5em;
    bottom: 2em;
    margin: 0 auto;
    max-width: calc(100vw - 1.5em - .4em - .5em);
    max-height: 30vh;
}

.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-syntax-highlighting */
pre.idl.highlight { color: #708090; }
.highlight:not(.idl) { background: hsl(24, 20%, 95%); }
code.highlight { padding: .1em; border-radius: .3em; }
pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; }
c-[a] { color: #990055 } /* Keyword.Declaration */
c-[b] { color: #990055 } /* Keyword.Type */
c-[c] { color: #708090 } /* Comment */
c-[d] { color: #708090 } /* Comment.Multiline */
c-[e] { color: #0077aa } /* Name.Attribute */
c-[f] { color: #669900 } /* Name.Tag */
c-[g] { color: #222222 } /* Name.Variable */
c-[k] { color: #990055 } /* Keyword */
c-[l] { color: #000000 } /* Literal */
c-[m] { color: #000000 } /* Literal.Number */
c-[n] { color: #0077aa } /* Name */
c-[o] { color: #999999 } /* Operator */
c-[p] { color: #999999 } /* Punctuation */
c-[s] { color: #a67f59 } /* Literal.String */
c-[t] { color: #a67f59 } /* Literal.String.Single */
c-[u] { color: #a67f59 } /* Literal.String.Double */
c-[cp] { color: #708090 } /* Comment.Preproc */
c-[c1] { color: #708090 } /* Comment.Single */
c-[cs] { color: #708090 } /* Comment.Special */
c-[kc] { color: #990055 } /* Keyword.Constant */
c-[kn] { color: #990055 } /* Keyword.Namespace */
c-[kp] { color: #990055 } /* Keyword.Pseudo */
c-[kr] { color: #990055 } /* Keyword.Reserved */
c-[ld] { color: #000000 } /* Literal.Date */
c-[nc] { color: #0077aa } /* Name.Class */
c-[no] { color: #0077aa } /* Name.Constant */
c-[nd] { color: #0077aa } /* Name.Decorator */
c-[ni] { color: #0077aa } /* Name.Entity */
c-[ne] { color: #0077aa } /* Name.Exception */
c-[nf] { color: #0077aa } /* Name.Function */
c-[nl] { color: #0077aa } /* Name.Label */
c-[nn] { color: #0077aa } /* Name.Namespace */
c-[py] { color: #0077aa } /* Name.Property */
c-[ow] { color: #999999 } /* Operator.Word */
c-[mb] { color: #000000 } /* Literal.Number.Bin */
c-[mf] { color: #000000 } /* Literal.Number.Float */
c-[mh] { color: #000000 } /* Literal.Number.Hex */
c-[mi] { color: #000000 } /* Literal.Number.Integer */
c-[mo] { color: #000000 } /* Literal.Number.Oct */
c-[sb] { color: #a67f59 } /* Literal.String.Backtick */
c-[sc] { color: #a67f59 } /* Literal.String.Char */
c-[sd] { color: #a67f59 } /* Literal.String.Doc */
c-[se] { color: #a67f59 } /* Literal.String.Escape */
c-[sh] { color: #a67f59 } /* Literal.String.Heredoc */
c-[si] { color: #a67f59 } /* Literal.String.Interpol */
c-[sx] { color: #a67f59 } /* Literal.String.Other */
c-[sr] { color: #a67f59 } /* Literal.String.Regex */
c-[ss] { color: #a67f59 } /* Literal.String.Symbol */
c-[vc] { color: #0077aa } /* Name.Variable.Class */
c-[vg] { color: #0077aa } /* Name.Variable.Global */
c-[vi] { color: #0077aa } /* Name.Variable.Instance */
c-[il] { color: #000000 } /* Literal.Number.Integer.Long */
</style>
 <body class="h-entry">
  <div class="head">
   <p data-fill-with="logo"></p>
   <h1 class="p-name no-ref" id="title">WebXR Hit Test Module</h1>
   <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Draft Community Group Report, <time class="dt-updated" datetime="1970-01-01">1 January 1970</time></span></h2>
   <div data-fill-with="spec-metadata">
    <dl>
     <dt>This version:
     <dd><a class="u-url" href="https://immersive-web.github.io/hit-test/">https://immersive-web.github.io/hit-test/</a>
     <dt class="editor">Editors:
     <dd class="editor p-author h-card vcard" data-editor-id="114482"><a class="p-name fn u-email email" href="mailto:bialpio@google.com">Piotr Bialecki</a> (<a class="p-org org" href="http://google.com/">Google</a>)
     <dd class="editor p-author h-card vcard"><span class="p-name fn"></span>
     <dt>Participate:
     <dd><a href="https://github.com/immersive-web/hit-test/issues/new">File an issue</a> (<a href="https://github.com/immersive-web/hit-test/issues">open issues</a>)
     <dd><a href="https://lists.w3.org/Archives/Public/public-immersive-web/">Mailing list archive</a>
     <dd><a href="irc://irc.w3.org:6665/">W3C’s #immersive-web IRC</a>
     <dd>
    </dl>
   </div>
   <div data-fill-with="warning"></div>
   <p class="copyright" data-fill-with="copyright"><a href="http://creativecommons.org/publicdomain/zero/1.0/" rel="license"><img alt="CC0" src="https://licensebuttons.net/p/zero/1.0/80x15.png"></a> To the extent possible under law, the editors have waived all copyright
and related or neighboring rights to this work.
In addition, as of 1 January 1970,
the editors have made this specification available under the <a href="http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0" rel="license">Open Web Foundation Agreement Version 1.0</a>,
which is available at http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
Parts of this work may be from another specification document.  If so, those parts are instead covered by the license of that specification document. </p>
   <hr title="Separator for header">
  </div>
  <div class="p-summary" data-fill-with="abstract">
   <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
   <p>Describes a method for performing hit tests against real world geometry to be used with the WebXR Device API.</p>
  </div>
  <div data-fill-with="at-risk"></div>
  <nav data-fill-with="table-of-contents" id="toc">
   <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
   <ol class="toc" role="directory">
    <li>
     <a href="#intro"><span class="secno">1</span> <span class="content">Introduction</span></a>
     <ol class="toc">
      <li><a href="#terminology"><span class="secno">1.1</span> <span class="content">Terminology</span></a>
     </ol>
    <li>
     <a href="#hit-test-options"><span class="secno">2</span> <span class="content">Hit test options</span></a>
     <ol class="toc">
      <li><a href="#hit-test-trackable-type-enum"><span class="secno">2.1</span> <span class="content">XRHitTestTrackableType</span></a>
      <li><a href="#hit-test-options-dictionary"><span class="secno">2.2</span> <span class="content">XRHitTestOptionsInit</span></a>
      <li><a href="#transient-input-hit-test-options-dictionary"><span class="secno">2.3</span> <span class="content">XRTransientInputHitTestOptionsInit</span></a>
     </ol>
    <li>
     <a href="#hit-test-source"><span class="secno">3</span> <span class="content">Hit test source</span></a>
     <ol class="toc">
      <li><a href="#hit-test-source-interface"><span class="secno">3.1</span> <span class="content">XRHitTestSource</span></a>
      <li><a href="#transient-input-hit-test-source-interface"><span class="secno">3.2</span> <span class="content">XRTransientInputHitTestSource</span></a>
     </ol>
    <li>
     <a href="#hit-test-result"><span class="secno">4</span> <span class="content">Hit test result</span></a>
     <ol class="toc">
      <li><a href="#xr-hit-test-result-interface"><span class="secno">4.1</span> <span class="content">XRHitTestResult</span></a>
      <li><a href="#xr-transient-input-hit-test-result-interface"><span class="secno">4.2</span> <span class="content">XRTransientInputHitTestResult</span></a>
     </ol>
    <li><a href="#requesting-hit-test"><span class="secno">5</span> <span class="content">Requesting hit test</span></a>
    <li><a href="#computing-hit-test-results"><span class="secno">6</span> <span class="content">Computing hit test results</span></a>
    <li><a href="#obtaining-hit-test-results"><span class="secno">7</span> <span class="content">Obtaining hit test results</span></a>
    <li>
     <a href="#geometric-primitives"><span class="secno">8</span> <span class="content">Geometric primitives</span></a>
     <ol class="toc">
      <li><a href="#xrray-interface"><span class="secno">8.1</span> <span class="content">XRRay</span></a>
     </ol>
    <li>
     <a href="#native-device-concepts"><span class="secno">9</span> <span class="content">Native device concepts</span></a>
     <ol class="toc">
      <li><a href="#native-hit-test-section"><span class="secno">9.1</span> <span class="content">Native hit test</span></a>
      <li><a href="#native-entity-type-section"><span class="secno">9.2</span> <span class="content">Native entity type</span></a>
      <li><a href="#native-hit-test-result-section"><span class="secno">9.3</span> <span class="content">Native hit test result</span></a>
     </ol>
    <li><a href="#ack"><span class="secno">10</span> <span class="content">Acknowledgements</span></a>
    <li><a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
    <li>
     <a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
     <ol class="toc">
      <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
      <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
     </ol>
    <li>
     <a href="#references"><span class="secno"></span> <span class="content">References</span></a>
     <ol class="toc">
      <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
     </ol>
    <li><a href="#idl-index"><span class="secno"></span> <span class="content">IDL Index</span></a>
    <li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
   </ol>
  </nav>
  <main>
   <h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#intro"></a></h2>
   <section class="non-normative">
    <p>This module describes a mechanism for allowing WebXR applications to cast rays into the users' real world environment and report back, to the best of the XR device’s knowledge, the point at which the ray intersected with a physical object along with the orientation of the intersected surface. This allows for virtual objects to be placed in alignment with those surfaces, such as placing objects realistically on the floor or attaching them to a wall. The hit test API is an extension to <a href="https://www.w3.org/TR/webxr/">WebXR Device API</a> and builds on top of <a href="https://github.com/immersive-web/webxr-ar-module/">WebXR Augmented Reality Module</a>.</p>
   </section>
   <h3 class="heading settled" data-level="1.1" id="terminology"><span class="secno">1.1. </span><span class="content">Terminology</span><a class="self-link" href="#terminology"></a></h3>
   <p>Hit testing, as understood by this document, is an act of checking if an idealised mathematical ray (half-line) intersects with real world as understood by the underlying Augmented Reality hardware &amp; software. Ray intersections against virtual objects created by the application consuming the API are explicitly out of scope of the hit test API.</p>
   <h2 class="heading settled" data-level="2" id="hit-test-options"><span class="secno">2. </span><span class="content">Hit test options</span><a class="self-link" href="#hit-test-options"></a></h2>
   <h3 class="heading settled" data-level="2.1" id="hit-test-trackable-type-enum"><span class="secno">2.1. </span><span class="content">XRHitTestTrackableType</span><a class="self-link" href="#hit-test-trackable-type-enum"></a></h3>
   <p>An <code class="idl"><a data-link-type="idl" href="#enumdef-xrhittesttrackabletype" id="ref-for-enumdef-xrhittesttrackabletype">XRHitTestTrackableType</a></code> enum specifies the type of entity that can be used for the purposes of hit test source creation.</p>
<pre class="idl highlight def"><c- b>enum</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="enum" data-export id="enumdef-xrhittesttrackabletype"><code><c- g>XRHitTestTrackableType</c-></code></dfn> {
  <a class="idl-code" data-link-type="enum-value" href="#dom-xrhittesttrackabletype-point" id="ref-for-dom-xrhittesttrackabletype-point"><c- s>"point"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-xrhittesttrackabletype-plane" id="ref-for-dom-xrhittesttrackabletype-plane"><c- s>"plane"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-xrhittesttrackabletype-mesh" id="ref-for-dom-xrhittesttrackabletype-mesh"><c- s>"mesh"</c-></a>
};
</pre>
   <ul>
    <li data-md>
     <p>A hit test trackable of type <dfn class="dfn-paneled idl-code" data-dfn-for="XRHitTestTrackableType" data-dfn-type="enum-value" data-export id="dom-xrhittesttrackabletype-point"><code>"point"</code></dfn> indicates that the hit test results will be computed based on the feature points detected by the underlying Augmented Reality system.</p>
    <li data-md>
     <p>A hit test trackable of type <dfn class="dfn-paneled idl-code" data-dfn-for="XRHitTestTrackableType" data-dfn-type="enum-value" data-export id="dom-xrhittesttrackabletype-plane"><code>"plane"</code></dfn> indicates that the hit test results will be computed based on the planes detected by the underlying Augmented Reality system.</p>
    <li data-md>
     <p>A hit test trackable of type <dfn class="dfn-paneled idl-code" data-dfn-for="XRHitTestTrackableType" data-dfn-type="enum-value" data-export id="dom-xrhittesttrackabletype-mesh"><code>"mesh"</code></dfn> indicates that the hit test results will be computed based on the meshes detected by the underlying Augmented Reality system.</p>
   </ul>
   <h3 class="heading settled" data-level="2.2" id="hit-test-options-dictionary"><span class="secno">2.2. </span><span class="content">XRHitTestOptionsInit</span><a class="self-link" href="#hit-test-options-dictionary"></a></h3>
   <p>An <code class="idl"><a data-link-type="idl" href="#dictdef-xrhittestoptionsinit" id="ref-for-dictdef-xrhittestoptionsinit">XRHitTestOptionsInit</a></code> dictionary represents a set of configurable values that affect the behavior of the hit test being performed.</p>
<pre class="idl highlight def"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-xrhittestoptionsinit"><code><c- g>XRHitTestOptionsInit</c-></code></dfn> {
  <c- b>required</c-> <a class="n" data-link-type="idl-name"><c- n>XRSpace</c-></a> <a class="idl-code" data-link-type="dict-member" data-type="XRSpace " href="#dom-xrhittestoptionsinit-space" id="ref-for-dom-xrhittestoptionsinit-space"><c- g>space</c-></a>;
  <c- b>FrozenArray</c->&lt;<a class="n" data-link-type="idl-name" href="#enumdef-xrhittesttrackabletype" id="ref-for-enumdef-xrhittesttrackabletype①"><c- n>XRHitTestTrackableType</c-></a>> <a class="idl-code" data-link-type="dict-member" data-type="FrozenArray<XRHitTestTrackableType> " href="#dom-xrhittestoptionsinit-entitytypes" id="ref-for-dom-xrhittestoptionsinit-entitytypes"><c- g>entityTypes</c-></a>;
  <a class="n" data-link-type="idl-name" href="#xrray" id="ref-for-xrray"><c- n>XRRay</c-></a> <a class="idl-code" data-link-type="dict-member" data-type="XRRay " href="#dom-xrhittestoptionsinit-offsetray" id="ref-for-dom-xrhittestoptionsinit-offsetray"><c- g>offsetRay</c-></a>;
};
</pre>
   <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="XRHitTestOptionsInit" data-dfn-type="dict-member" data-export id="dom-xrhittestoptionsinit-space"><code>space</code></dfn> dictionary member specifies <code class="idl"><a data-link-type="idl">XRSpace</a></code> relative to which the <code class="idl"><a data-link-type="idl" href="#dom-xrhittestoptionsinit-offsetray" id="ref-for-dom-xrhittestoptionsinit-offsetray①">offsetRay</a></code> is specified.</p>
   <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="XRHitTestOptionsInit" data-dfn-type="dict-member" data-export id="dom-xrhittestoptionsinit-entitytypes"><code>entityTypes</code></dfn> dictionary member specifies array of <a class="idl-code" data-link-type="enum" href="#enumdef-xrhittesttrackabletype" id="ref-for-enumdef-xrhittesttrackabletype②">XRHitTestTrackableTypes</a> that will be used to compute results of the hit test.</p>
   <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="XRHitTestOptionsInit" data-dfn-type="dict-member" data-export id="dom-xrhittestoptionsinit-offsetray"><code>offsetRay</code></dfn> dictionary member specifies <code class="idl"><a data-link-type="idl" href="#xrray" id="ref-for-xrray①">XRRay</a></code> that will be used to perform hit test. The <code class="idl"><a data-link-type="idl" href="#dom-xrhittestoptionsinit-offsetray" id="ref-for-dom-xrhittestoptionsinit-offsetray②">offsetRay</a></code> will be interpreted as if expressed in a coordinate system defined by <code class="idl"><a data-link-type="idl" href="#dom-xrhittestoptionsinit-space" id="ref-for-dom-xrhittestoptionsinit-space①">space</a></code>.</p>
   <p>The <code class="idl"><a data-link-type="idl" href="#dictdef-xrhittestoptionsinit" id="ref-for-dictdef-xrhittestoptionsinit①">XRHitTestOptionsInit</a></code> dictionary has an associated <dfn class="dfn-paneled" data-dfn-for="XRHitTestOptionsInit" data-dfn-type="dfn" data-noexport id="xrhittestoptionsinit-effective-entitytypes">effective entityTypes</dfn> which is set to <code class="idl"><a data-link-type="idl" href="#dom-xrhittestoptionsinit-entitytypes" id="ref-for-dom-xrhittestoptionsinit-entitytypes①">entityTypes</a></code> if it was provided at dictionary construction time. If the <code class="idl"><a data-link-type="idl" href="#dom-xrhittestoptionsinit-entitytypes" id="ref-for-dom-xrhittestoptionsinit-entitytypes②">entityTypes</a></code> was not provided at construction time, the <a data-link-type="dfn" href="#xrhittestoptionsinit-effective-entitytypes" id="ref-for-xrhittestoptionsinit-effective-entitytypes">effective entityTypes</a> is set to an array containing single element, <code class="idl"><a data-link-type="idl" href="#dom-xrhittesttrackabletype-plane" id="ref-for-dom-xrhittesttrackabletype-plane①">"plane"</a></code>.</p>
   <p>The <code class="idl"><a data-link-type="idl" href="#dictdef-xrhittestoptionsinit" id="ref-for-dictdef-xrhittestoptionsinit②">XRHitTestOptionsInit</a></code> dictionary has an associated <dfn class="dfn-paneled" data-dfn-for="XRHitTestOptionsInit" data-dfn-type="dfn" data-noexport id="xrhittestoptionsinit-effective-offsetray">effective offsetRay</dfn> which is set to <code class="idl"><a data-link-type="idl" href="#dom-xrhittestoptionsinit-offsetray" id="ref-for-dom-xrhittestoptionsinit-offsetray③">offsetRay</a></code> if it was provided at dictionary construction time. If the <code class="idl"><a data-link-type="idl" href="#dom-xrhittestoptionsinit-offsetray" id="ref-for-dom-xrhittestoptionsinit-offsetray④">offsetRay</a></code> was not provided at construction time, the <a data-link-type="dfn" href="#xrhittestoptionsinit-effective-offsetray" id="ref-for-xrhittestoptionsinit-effective-offsetray">effective offsetRay</a> is set to an <code class="idl"><a data-link-type="idl" href="#xrray" id="ref-for-xrray②">XRRay</a></code> constructed by invoking <code class="idl"><a data-link-type="idl" href="#dom-xrray-xrray" id="ref-for-dom-xrray-xrray">XRRay()</a></code> without any parameters.</p>
   <h3 class="heading settled" data-level="2.3" id="transient-input-hit-test-options-dictionary"><span class="secno">2.3. </span><span class="content">XRTransientInputHitTestOptionsInit</span><a class="self-link" href="#transient-input-hit-test-options-dictionary"></a></h3>
   <p>An <code class="idl"><a data-link-type="idl" href="#dictdef-xrtransientinputhittestoptionsinit" id="ref-for-dictdef-xrtransientinputhittestoptionsinit">XRTransientInputHitTestOptionsInit</a></code> dictionary represents a set of configurable values that affect the behavior of the hit test for transient input that is being performed.</p>
<pre class="idl highlight def"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-xrtransientinputhittestoptionsinit"><code><c- g>XRTransientInputHitTestOptionsInit</c-></code></dfn> {
  <c- b>required</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="dict-member" data-type="DOMString " href="#dom-xrtransientinputhittestoptionsinit-profile" id="ref-for-dom-xrtransientinputhittestoptionsinit-profile"><c- g>profile</c-></a>;
  <c- b>FrozenArray</c->&lt;<a class="n" data-link-type="idl-name" href="#enumdef-xrhittesttrackabletype" id="ref-for-enumdef-xrhittesttrackabletype③"><c- n>XRHitTestTrackableType</c-></a>> <a class="idl-code" data-link-type="dict-member" data-type="FrozenArray<XRHitTestTrackableType> " href="#dom-xrtransientinputhittestoptionsinit-entitytypes" id="ref-for-dom-xrtransientinputhittestoptionsinit-entitytypes"><c- g>entityTypes</c-></a>;
  <a class="n" data-link-type="idl-name" href="#xrray" id="ref-for-xrray③"><c- n>XRRay</c-></a> <a class="idl-code" data-link-type="dict-member" data-type="XRRay " href="#dom-xrtransientinputhittestoptionsinit-offsetray" id="ref-for-dom-xrtransientinputhittestoptionsinit-offsetray"><c- g>offsetRay</c-></a>;
};
</pre>
   <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="XRTransientInputHitTestOptionsInit" data-dfn-type="dict-member" data-export id="dom-xrtransientinputhittestoptionsinit-profile"><code>profile</code></dfn> dictionary member specifies an <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xrinputsource-input-profile-name" id="ref-for-xrinputsource-input-profile-name">input profile name</a> of the transient input source that will be used to compute hit test results.</p>
   <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="XRTransientInputHitTestOptionsInit" data-dfn-type="dict-member" data-export id="dom-xrtransientinputhittestoptionsinit-entitytypes"><code>entityTypes</code></dfn> dictionary member specifies array of <a class="idl-code" data-link-type="enum" href="#enumdef-xrhittesttrackabletype" id="ref-for-enumdef-xrhittesttrackabletype④">XRHitTestTrackableTypes</a> that will be used to compute results of the hit test.</p>
   <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="XRTransientInputHitTestOptionsInit" data-dfn-type="dict-member" data-export id="dom-xrtransientinputhittestoptionsinit-offsetray"><code>offsetRay</code></dfn> dictionary member specifies <code class="idl"><a data-link-type="idl" href="#xrray" id="ref-for-xrray④">XRRay</a></code> that will be used to perform hit test. The <code class="idl"><a data-link-type="idl" href="#dom-xrtransientinputhittestoptionsinit-offsetray" id="ref-for-dom-xrtransientinputhittestoptionsinit-offsetray①">offsetRay</a></code> will be interpreted as if expressed in a coordinate system defined by <code class="idl"><a data-link-type="idl">XRInputSource</a></code> whose profile matches the passed in <code class="idl"><a data-link-type="idl" href="#dom-xrtransientinputhittestoptionsinit-profile" id="ref-for-dom-xrtransientinputhittestoptionsinit-profile①">profile</a></code> when computing hit test results for transient input sources.</p>
   <p>The <code class="idl"><a data-link-type="idl" href="#dictdef-xrtransientinputhittestoptionsinit" id="ref-for-dictdef-xrtransientinputhittestoptionsinit①">XRTransientInputHitTestOptionsInit</a></code> dictionary has an associated <dfn class="dfn-paneled" data-dfn-for="XRTransientInputHitTestOptionsInit" data-dfn-type="dfn" data-noexport id="xrtransientinputhittestoptionsinit-effective-entitytypes">effective entityTypes</dfn> which is set to <code class="idl"><a data-link-type="idl" href="#dom-xrtransientinputhittestoptionsinit-entitytypes" id="ref-for-dom-xrtransientinputhittestoptionsinit-entitytypes①">entityTypes</a></code> if it was provided at dictionary construction time. If the <code class="idl"><a data-link-type="idl" href="#dom-xrtransientinputhittestoptionsinit-entitytypes" id="ref-for-dom-xrtransientinputhittestoptionsinit-entitytypes②">entityTypes</a></code> was not provided at construction time, the <a data-link-type="dfn" href="#xrtransientinputhittestoptionsinit-effective-entitytypes" id="ref-for-xrtransientinputhittestoptionsinit-effective-entitytypes">effective entityTypes</a> is set to an array containing single element, <code class="idl"><a data-link-type="idl" href="#dom-xrhittesttrackabletype-plane" id="ref-for-dom-xrhittesttrackabletype-plane②">"plane"</a></code>.</p>
   <p>The <code class="idl"><a data-link-type="idl" href="#dictdef-xrtransientinputhittestoptionsinit" id="ref-for-dictdef-xrtransientinputhittestoptionsinit②">XRTransientInputHitTestOptionsInit</a></code> dictionary has an associated <dfn class="dfn-paneled" data-dfn-for="XRTransientInputHitTestOptionsInit" data-dfn-type="dfn" data-noexport id="xrtransientinputhittestoptionsinit-effective-offsetray">effective offsetRay</dfn> which is set to <code class="idl"><a data-link-type="idl" href="#dom-xrtransientinputhittestoptionsinit-offsetray" id="ref-for-dom-xrtransientinputhittestoptionsinit-offsetray②">offsetRay</a></code> if it was provided at dictionary construction time. If the <code class="idl"><a data-link-type="idl" href="#dom-xrtransientinputhittestoptionsinit-offsetray" id="ref-for-dom-xrtransientinputhittestoptionsinit-offsetray③">offsetRay</a></code> was not provided at construction time, the <a data-link-type="dfn" href="#xrtransientinputhittestoptionsinit-effective-offsetray" id="ref-for-xrtransientinputhittestoptionsinit-effective-offsetray">effective offsetRay</a> is set to an <code class="idl"><a data-link-type="idl" href="#xrray" id="ref-for-xrray⑤">XRRay</a></code> constructed by invoking <code class="idl"><a data-link-type="idl" href="#dom-xrray-xrray" id="ref-for-dom-xrray-xrray①">XRRay()</a></code> without any parameters.</p>
   <h2 class="heading settled" data-level="3" id="hit-test-source"><span class="secno">3. </span><span class="content">Hit test source</span><a class="self-link" href="#hit-test-source"></a></h2>
   <h3 class="heading settled" data-level="3.1" id="hit-test-source-interface"><span class="secno">3.1. </span><span class="content">XRHitTestSource</span><a class="self-link" href="#hit-test-source-interface"></a></h3>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed"><c- g>Exposed</c-></a>=<c- n>Window</c->]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="xrhittestsource"><code><c- g>XRHitTestSource</c-></code></dfn> {
  <c- b>void</c-> <a class="idl-code" data-link-type="method" href="#dom-xrhittestsource-cancel" id="ref-for-dom-xrhittestsource-cancel"><c- g>cancel</c-></a>();
};
</pre>
   <p>The <code class="idl"><a data-link-type="idl" href="#xrhittestsource" id="ref-for-xrhittestsource">XRHitTestSource</a></code> object serves as a handle to an active subscription to hit test.</p>
   <p>Each <code class="idl"><a data-link-type="idl" href="#xrhittestsource" id="ref-for-xrhittestsource①">XRHitTestSource</a></code> has an associated <dfn class="dfn-paneled" data-dfn-for="XRHitTestSource" data-dfn-type="dfn" data-noexport id="xrhittestsource-session">session</dfn> which stores an <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#xrsession-interface" id="ref-for-xrsession-interface">XRSession</a></code> that was used to create the hit test source.</p>
   <p>Each <code class="idl"><a data-link-type="idl" href="#xrhittestsource" id="ref-for-xrhittestsource②">XRHitTestSource</a></code> has an associated <dfn class="dfn-paneled" data-dfn-for="XRHitTestSource" data-dfn-type="dfn" data-noexport id="xrhittestsource-native-origin">native origin</dfn> which stores information sufficient to identify the <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xrspace-native-origin" id="ref-for-xrspace-native-origin">native origin</a> of an <code class="idl"><a data-link-type="idl">XRSpace</a></code> that was used to <a data-link-type="dfn" href="#request-hit-test" id="ref-for-request-hit-test">request hit test</a>. This information will be subsequently used when computing hit test results.</p>
   <p>Each <code class="idl"><a data-link-type="idl" href="#xrhittestsource" id="ref-for-xrhittestsource③">XRHitTestSource</a></code> has an associated <dfn class="dfn-paneled" data-dfn-for="XRHitTestSource" data-dfn-type="dfn" data-noexport id="xrhittestsource-entity-types">entity types</dfn>, which is an array of <a class="idl-code" data-link-type="enum" href="#enumdef-xrhittesttrackabletype" id="ref-for-enumdef-xrhittesttrackabletype⑤">XRHitTestTrackableTypes</a> describing which entity types will be considered when computing hit test results.</p>
   <p>Each <code class="idl"><a data-link-type="idl" href="#xrhittestsource" id="ref-for-xrhittestsource④">XRHitTestSource</a></code> has an associated <dfn class="dfn-paneled" data-dfn-for="XRHitTestSource" data-dfn-type="dfn" data-noexport id="xrhittestsource-offset-ray">offset ray</dfn>, which is an <code class="idl"><a data-link-type="idl" href="#xrray" id="ref-for-xrray⑥">XRRay</a></code> that will be used when computing hit test results.</p>
   <p><code class="idl"><a data-link-type="idl" href="#xrhittestsource" id="ref-for-xrhittestsource⑤">XRHitTestSource</a></code> is considered <dfn class="dfn-paneled" data-dfn-for="XRHitTestSource" data-dfn-type="dfn" data-noexport id="xrhittestsource-active">active</dfn> for as long as it’s present in <a data-link-type="dfn" href="#xrhittestsource-session" id="ref-for-xrhittestsource-session">session</a>'s <a data-link-type="dfn" href="#xrsession-set-of-active-hit-test-sources" id="ref-for-xrsession-set-of-active-hit-test-sources">set of active hit test sources</a>.</p>
   <div class="algorithm" data-algorithm="create-hit-test-source">
    <p>In order to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="create-a-hit-test-source">create a hit test source</dfn> from <var>session</var>, <var>space</var>, <var>entityTypes</var> and <var>offsetRay</var>, the user agent MUST run the following steps:</p>
    <ol>
     <li data-md>
      <p>Let <var>hitTestSource</var> be a new <code class="idl"><a data-link-type="idl" href="#xrhittestsource" id="ref-for-xrhittestsource⑥">XRHitTestSource</a></code>.</p>
     <li data-md>
      <p>Initialize <var>hitTestSource</var>’s <a data-link-type="dfn" href="#xrhittestsource-session" id="ref-for-xrhittestsource-session①">session</a> to <var>session</var>.</p>
     <li data-md>
      <p>Initialize <var>hitTestSource</var>’s <a data-link-type="dfn" href="#xrhittestsource-native-origin" id="ref-for-xrhittestsource-native-origin">native origin</a> to <var>space</var>’s <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xrspace-native-origin" id="ref-for-xrspace-native-origin①">native origin</a>.</p>
     <li data-md>
      <p>Initialize <var>hitTestSource</var>’s <a data-link-type="dfn" href="#xrhittestsource-entity-types" id="ref-for-xrhittestsource-entity-types">entity types</a> to <var>entityTypes</var>.</p>
     <li data-md>
      <p>Compute <var>transformedOffsetRay</var> from <var>offsetRay</var> and <var>space</var> such that <var>transformedOffsetRay</var>, when interpreted in <var>space</var>’s <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xrspace-native-origin" id="ref-for-xrspace-native-origin②">native origin</a> coordinate system, represents the same ray as <var>offsetRay</var> does when interpreted in <var>space</var>’s <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xrspace-effective-origin" id="ref-for-xrspace-effective-origin">effective origin</a> coordinate system.</p>
     <li data-md>
      <p>Initialize <var>hitTestSource</var>’s <a data-link-type="dfn" href="#xrhittestsource-offset-ray" id="ref-for-xrhittestsource-offset-ray">offset ray</a> to <var>transformedOffsetRay</var>.</p>
     <li data-md>
      <p>Return <var>hitTestSource</var>.</p>
    </ol>
   </div>
   <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="XRHitTestSource" data-dfn-type="method" data-export id="dom-xrhittestsource-cancel"><code>cancel()</code></dfn> method, when invoked on <code class="idl"><a data-link-type="idl" href="#xrhittestsource" id="ref-for-xrhittestsource⑦">XRHitTestSource</a></code> <var>hitTestSource</var>, signals that the application is no longer interested in obtaining hit test results for the specified <var>hitTestSource</var>.</p>
   <div class="algorithm" data-algorithm="cancel-hit-test-source">
    <p>When <code class="idl"><a data-link-type="idl" href="#dom-xrhittestsource-cancel" id="ref-for-dom-xrhittestsource-cancel①">cancel()</a></code> method is invoked, the user agent MUST <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="cancel-a-hit-test-source">cancel a hit test source</dfn> by running the following steps:</p>
    <ol>
     <li data-md>
      <p>If the <var>hitTestSource</var> is not <a data-link-type="dfn" href="#xrhittestsource-active" id="ref-for-xrhittestsource-active">active</a>, throw an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror">InvalidStateError</a></code> and abort these steps.</p>
     <li data-md>
      <p>Remove <var>hitTestSource</var> from <a data-link-type="dfn" href="#xrhittestsource-session" id="ref-for-xrhittestsource-session②">session</a>'s <a data-link-type="dfn" href="#xrsession-set-of-active-hit-test-sources" id="ref-for-xrsession-set-of-active-hit-test-sources①">set of active hit test sources</a>.</p>
    </ol>
   </div>
   <p>When the application no longer retains any references to a particular <code class="idl"><a data-link-type="idl" href="#xrhittestsource" id="ref-for-xrhittestsource⑧">XRHitTestSource</a></code> <var>hitTestSource</var>, the user agent MAY <a data-link-type="dfn" href="#cancel-a-hit-test-source" id="ref-for-cancel-a-hit-test-source">cancel a hit test source</a> if <var>hitTestSource</var> is still <a data-link-type="dfn" href="#xrhittestsource-active" id="ref-for-xrhittestsource-active①">active</a>. The cancelation MAY happen at an unspecified time (or not at all) and the application SHOULD NOT rely on this behavior for cleanup.</p>
   <h3 class="heading settled" data-level="3.2" id="transient-input-hit-test-source-interface"><span class="secno">3.2. </span><span class="content">XRTransientInputHitTestSource</span><a class="self-link" href="#transient-input-hit-test-source-interface"></a></h3>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①"><c- g>Exposed</c-></a>=<c- n>Window</c->]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="xrtransientinputhittestsource"><code><c- g>XRTransientInputHitTestSource</c-></code></dfn> {
  <c- b>void</c-> <a class="idl-code" data-link-type="method" href="#dom-xrtransientinputhittestsource-cancel" id="ref-for-dom-xrtransientinputhittestsource-cancel"><c- g>cancel</c-></a>();
};
</pre>
   <p>The <code class="idl"><a data-link-type="idl" href="#xrtransientinputhittestsource" id="ref-for-xrtransientinputhittestsource">XRTransientInputHitTestSource</a></code> object serves as a handle to an active subscription to hit test for transient input sources.</p>
   <p>Each <code class="idl"><a data-link-type="idl" href="#xrtransientinputhittestsource" id="ref-for-xrtransientinputhittestsource①">XRTransientInputHitTestSource</a></code> has an associated <dfn class="dfn-paneled" data-dfn-for="XRTransientInputHitTestSource" data-dfn-type="dfn" data-noexport id="xrtransientinputhittestsource-session">session</dfn> which stores an <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#xrsession-interface" id="ref-for-xrsession-interface①">XRSession</a></code> that was used to create the hit test source.</p>
   <p>Each <code class="idl"><a data-link-type="idl" href="#xrtransientinputhittestsource" id="ref-for-xrtransientinputhittestsource②">XRTransientInputHitTestSource</a></code> has an associated <dfn class="dfn-paneled" data-dfn-for="XRTransientInputHitTestSource" data-dfn-type="dfn" data-noexport id="xrtransientinputhittestsource-profile">profile</dfn> which stores <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xrinputsource-input-profile-name" id="ref-for-xrinputsource-input-profile-name①">input profile name</a> of an input source. This information will be subsequently used when computing hit test results for transient input sources.</p>
   <p>Each <code class="idl"><a data-link-type="idl" href="#xrtransientinputhittestsource" id="ref-for-xrtransientinputhittestsource③">XRTransientInputHitTestSource</a></code> has an associated <dfn class="dfn-paneled" data-dfn-for="XRTransientInputHitTestSource" data-dfn-type="dfn" data-noexport id="xrtransientinputhittestsource-entity-types">entity types</dfn>, which is an array of <a class="idl-code" data-link-type="enum" href="#enumdef-xrhittesttrackabletype" id="ref-for-enumdef-xrhittesttrackabletype⑥">XRHitTestTrackableTypes</a> describing which entity types will be considered when computing hit test results.</p>
   <p>Each <code class="idl"><a data-link-type="idl" href="#xrtransientinputhittestsource" id="ref-for-xrtransientinputhittestsource④">XRTransientInputHitTestSource</a></code> has an associated <dfn class="dfn-paneled" data-dfn-for="XRTransientInputHitTestSource" data-dfn-type="dfn" data-noexport id="xrtransientinputhittestsource-offset-ray">offset ray</dfn>, which is an <code class="idl"><a data-link-type="idl" href="#xrray" id="ref-for-xrray⑦">XRRay</a></code> that will be used when computing hit test results.</p>
   <p><code class="idl"><a data-link-type="idl" href="#xrtransientinputhittestsource" id="ref-for-xrtransientinputhittestsource⑤">XRTransientInputHitTestSource</a></code> is considered <dfn class="dfn-paneled" data-dfn-for="XRTransientInputHitTestSource" data-dfn-type="dfn" data-noexport id="xrtransientinputhittestsource-active">active</dfn> for as long as it’s present in <a data-link-type="dfn" href="#xrtransientinputhittestsource-session" id="ref-for-xrtransientinputhittestsource-session">session</a>'s <a data-link-type="dfn" href="#xrsession-set-of-active-hit-test-sources-for-transient-input" id="ref-for-xrsession-set-of-active-hit-test-sources-for-transient-input">set of active hit test sources for transient input</a>.</p>
   <div class="algorithm" data-algorithm="create-hit-test-source-transient">
    <p>In order to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="create-a-hit-test-source-for-transient-input">create a hit test source for transient input</dfn> from <var>session</var>, <var>profile</var>, <var>entityTypes</var> and <var>offsetRay</var>, the user agent MUST run the following steps:</p>
    <ol>
     <li data-md>
      <p>Let <var>hitTestSource</var> be a new <code class="idl"><a data-link-type="idl" href="#xrtransientinputhittestsource" id="ref-for-xrtransientinputhittestsource⑥">XRTransientInputHitTestSource</a></code>.</p>
     <li data-md>
      <p>Initialize <var>hitTestSource</var>’s <a data-link-type="dfn" href="#xrtransientinputhittestsource-session" id="ref-for-xrtransientinputhittestsource-session①">session</a> to <var>session</var>.</p>
     <li data-md>
      <p>Initialize <var>hitTestSource</var>’s <a data-link-type="dfn" href="#xrtransientinputhittestsource-profile" id="ref-for-xrtransientinputhittestsource-profile">profile</a> to <var>profile</var>.</p>
     <li data-md>
      <p>Initialize <var>hitTestSource</var>’s <a data-link-type="dfn" href="#xrtransientinputhittestsource-entity-types" id="ref-for-xrtransientinputhittestsource-entity-types">entity types</a> to <var>entityTypes</var>.</p>
     <li data-md>
      <p>Initialize <var>hitTestSource</var>’s <a data-link-type="dfn" href="#xrtransientinputhittestsource-offset-ray" id="ref-for-xrtransientinputhittestsource-offset-ray">offset ray</a> to <var>offsetRay</var>.</p>
     <li data-md>
      <p>Return <var>hitTestSource</var>.</p>
    </ol>
   </div>
   <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="XRTransientInputHitTestSource" data-dfn-type="method" data-export id="dom-xrtransientinputhittestsource-cancel"><code>cancel()</code></dfn> method, when invoked on <code class="idl"><a data-link-type="idl" href="#xrtransientinputhittestsource" id="ref-for-xrtransientinputhittestsource⑦">XRTransientInputHitTestSource</a></code> <var>hitTestSource</var>, signals that the application is no longer interested in obtaining hit test results for the specified <var>hitTestSource</var>.</p>
   <div class="algorithm" data-algorithm="cancel-hit-test-source-transient">
    <p>When <code class="idl"><a data-link-type="idl" href="#dom-xrtransientinputhittestsource-cancel" id="ref-for-dom-xrtransientinputhittestsource-cancel①">cancel()</a></code> method is invoked, the user agent MUST <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="cancel-a-hit-test-source-for-transient-input">cancel a hit test source for transient input</dfn> by running the following steps:</p>
    <ol>
     <li data-md>
      <p>If the <var>hitTestSource</var> is not <a data-link-type="dfn" href="#xrtransientinputhittestsource-active" id="ref-for-xrtransientinputhittestsource-active">active</a>, throw an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror①">InvalidStateError</a></code> and abort these steps.</p>
     <li data-md>
      <p>Remove <var>hitTestSource</var> from <a data-link-type="dfn" href="#xrhittestsource-session" id="ref-for-xrhittestsource-session③">session</a>'s <a data-link-type="dfn" href="#xrsession-set-of-active-hit-test-sources-for-transient-input" id="ref-for-xrsession-set-of-active-hit-test-sources-for-transient-input①">set of active hit test sources for transient input</a>.</p>
    </ol>
   </div>
   <p>When the application no longer retains any references to a particular <code class="idl"><a data-link-type="idl" href="#xrtransientinputhittestsource" id="ref-for-xrtransientinputhittestsource⑧">XRTransientInputHitTestSource</a></code> <var>hitTestSource</var>, the user agent MAY <a data-link-type="dfn" href="#cancel-a-hit-test-source-for-transient-input" id="ref-for-cancel-a-hit-test-source-for-transient-input">cancel a hit test source for transient input</a> if <var>hitTestSource</var> is still <a data-link-type="dfn" href="#xrtransientinputhittestsource-active" id="ref-for-xrtransientinputhittestsource-active①">active</a>. The cancelation MAY happen at an unspecified time (or not at all) and the application SHOULD NOT rely on this behavior for cleanup.</p>
   <h2 class="heading settled" data-level="4" id="hit-test-result"><span class="secno">4. </span><span class="content">Hit test result</span><a class="self-link" href="#hit-test-result"></a></h2>
   <h3 class="heading settled" data-level="4.1" id="xr-hit-test-result-interface"><span class="secno">4.1. </span><span class="content">XRHitTestResult</span><a class="self-link" href="#xr-hit-test-result-interface"></a></h3>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext②"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed②"><c- g>Exposed</c-></a>=<c- n>Window</c->]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="xrhittestresult"><code><c- g>XRHitTestResult</c-></code></dfn> {
  <a class="n" data-link-type="idl-name"><c- n>XRPose</c-></a>? <a class="idl-code" data-link-type="method" href="#dom-xrhittestresult-getpose" id="ref-for-dom-xrhittestresult-getpose"><c- g>getPose</c-></a>(<a class="n" data-link-type="idl-name"><c- n>XRSpace</c-></a> <dfn class="idl-code" data-dfn-for="XRHitTestResult/getPose(baseSpace)" data-dfn-type="argument" data-export id="dom-xrhittestresult-getpose-basespace-basespace"><code><c- g>baseSpace</c-></code><a class="self-link" href="#dom-xrhittestresult-getpose-basespace-basespace"></a></dfn>);
};
</pre>
   <p>A <code class="idl"><a data-link-type="idl" href="#xrhittestresult" id="ref-for-xrhittestresult">XRHitTestResult</a></code> contains single result of a hit test. It encapsulates information about the intersection point of the ray used to perform the hit test with user’s environment as understood by the underlying <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xr-device" id="ref-for-xr-device">XR device</a>.</p>
   <p>Each <code class="idl"><a data-link-type="idl" href="#xrhittestresult" id="ref-for-xrhittestresult①">XRHitTestResult</a></code> has an associated <dfn class="dfn-paneled" data-dfn-for="XRHitTestResult" data-dfn-type="dfn" data-noexport id="xrhittestresult-frame">frame</dfn> which is an <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#xrframe-interface" id="ref-for-xrframe-interface">XRFrame</a></code> for which the result was computed.</p>
   <p>Each <code class="idl"><a data-link-type="idl" href="#xrhittestresult" id="ref-for-xrhittestresult②">XRHitTestResult</a></code> has an associated <dfn class="dfn-paneled" data-dfn-for="XRHitTestResult" data-dfn-type="dfn" data-noexport id="xrhittestresult-native-origin">native origin</dfn>. This native origin defines new coordinate system whose Y axis represents the surface’s normal vector at the intersection point.</p>
   <div class="algorithm" data-algorithm="create-hit-test-result">
    <p>In order to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="create-a-hit-test-result">create a hit test result</dfn> given <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#xrframe-interface" id="ref-for-xrframe-interface①">XRFrame</a></code> <var>frame</var>, array of <code class="idl"><a data-link-type="idl" href="#enumdef-xrhittesttrackabletype" id="ref-for-enumdef-xrhittesttrackabletype⑦">XRHitTestTrackableType</a></code> <var>entityTypes</var>, and <a data-link-type="dfn" href="#native-hit-test-result" id="ref-for-native-hit-test-result">native hit test result</a> <var>nativeResult</var>, the user agent MUST run the following steps:</p>
    <ol>
     <li data-md>
      <p>Let <var>hitTestResult</var> be a new <code class="idl"><a data-link-type="idl" href="#xrhittestresult" id="ref-for-xrhittestresult③">XRHitTestResult</a></code>.</p>
     <li data-md>
      <p>Let <var>session</var> be <var>frame</var>’s <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#dom-xrframe-session" id="ref-for-dom-xrframe-session">session</a>.</p>
     <li data-md>
      <p>Let <var>device</var> be <var>session</var>’s <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xrsession-xr-device" id="ref-for-xrsession-xr-device">XR device</a>.</p>
     <li data-md>
      <p>Query <var>device</var> for <a data-link-type="dfn" href="#native-entity-type" id="ref-for-native-entity-type">native entity type</a>, <var>nativeEntityType</var>, of the <var>nativeResult</var>.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="#convert-from-native-entity-type" id="ref-for-convert-from-native-entity-type">Convert from native entity type</a> <var>nativeEntityType</var> to <var>entityType</var>.</p>
     <li data-md>
      <p>If <var>entityType</var> is <code>null</code> or is not present in <var>entityTypes</var> array, return <code>null</code> and abort these steps.</p>
     <li data-md>
      <p>Set <var>hitTestResult</var>’s <a data-link-type="dfn" href="#xrhittestresult-frame" id="ref-for-xrhittestresult-frame">frame</a> to <var>frame</var>.</p>
     <li data-md>
      <p>Set <var>hitTestResult</var>’s <a data-link-type="dfn" href="#xrhittestresult-native-origin" id="ref-for-xrhittestresult-native-origin">native origin</a> to a native origin obtained from <var>nativeResult</var>.</p>
     <li data-md>
      <p>Return <var>hitTestResult</var>.</p>
    </ol>
   </div>
   <p>The <code class="idl"><a data-link-type="idl" href="#dom-xrhittestresult-getpose" id="ref-for-dom-xrhittestresult-getpose①">getPose(baseSpace)</a></code> method, when invoked on <code class="idl"><a data-link-type="idl" href="#xrhittestresult" id="ref-for-xrhittestresult④">XRHitTestResult</a></code> <var>hitTestResult</var> with <var>baseSpace</var> parameter, provides the pose of the <var>hitTestResult</var> relative to <var>baseSpace</var> as an <code class="idl"><a data-link-type="idl">XRPose</a></code>, at the time represented by <a data-link-type="dfn" href="#xrhittestresult-frame" id="ref-for-xrhittestresult-frame①">frame</a>.</p>
   <div class="algorithm" data-algorithm="populate-result-pose">
    <p>When <dfn class="dfn-paneled idl-code" data-dfn-for="XRHitTestResult" data-dfn-type="method" data-export id="dom-xrhittestresult-getpose"><code>getPose(<var>baseSpace</var>)</code></dfn> method is invoked on <var>hitTestResult</var>, the user agent MUST run the following steps:</p>
    <ol>
     <li data-md>
      <p>Let <var>frame</var> be the <var>hitTestResult</var>’s <a data-link-type="dfn" href="#xrhittestresult-frame" id="ref-for-xrhittestresult-frame②">frame</a>.</p>
     <li data-md>
      <p>If <var>frame</var>’s <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xrframe-active" id="ref-for-xrframe-active">active</a> boolean is <code>false</code>, throw an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror②">InvalidStateError</a></code> and abort these steps.</p>
     <li data-md>
      <p>Let <var>pose</var> be a new <code class="idl"><a data-link-type="idl">XRPose</a></code>.</p>
     <li data-md>
      <p>Let <var>space</var> be a new <code class="idl"><a data-link-type="idl">XRSpace</a></code>, with <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xrspace-native-origin" id="ref-for-xrspace-native-origin③">native origin</a> set to <a data-link-type="dfn" href="#xrhittestresult-native-origin" id="ref-for-xrhittestresult-native-origin①">native origin</a>, <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xrspace-origin-offset" id="ref-for-xrspace-origin-offset">origin offset</a> set to <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#identity-transform" id="ref-for-identity-transform">identity transform</a>, and <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xrspace-session" id="ref-for-xrspace-session">session</a> set to <a data-link-type="dfn" href="#xrhittestresult-frame" id="ref-for-xrhittestresult-frame③">frame</a>'s session.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#populate-the-pose" id="ref-for-populate-the-pose">Populate the pose</a> of <var>space</var> in <var>baseSpace</var> at the time represented by <var>frame</var> into <var>pose</var>.</p>
     <li data-md>
      <p>Return <var>pose</var>.</p>
    </ol>
   </div>
   <h3 class="heading settled" data-level="4.2" id="xr-transient-input-hit-test-result-interface"><span class="secno">4.2. </span><span class="content">XRTransientInputHitTestResult</span><a class="self-link" href="#xr-transient-input-hit-test-result-interface"></a></h3>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext③"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed③"><c- g>Exposed</c-></a>=<c- n>Window</c->]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="xrtransientinputhittestresult"><code><c- g>XRTransientInputHitTestResult</c-></code></dfn> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name"><c- n>XRInputSource</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="XRTransientInputHitTestResult" data-dfn-type="attribute" data-export data-readonly data-type="XRInputSource" id="dom-xrtransientinputhittestresult-inputsource"><code><c- g>inputSource</c-></code></dfn>;
  <c- b>readonly</c-> <c- b>attribute</c-> <c- b>FrozenArray</c->&lt;<a class="n" data-link-type="idl-name" href="#xrhittestresult" id="ref-for-xrhittestresult⑤"><c- n>XRHitTestResult</c-></a>> <dfn class="dfn-paneled idl-code" data-dfn-for="XRTransientInputHitTestResult" data-dfn-type="attribute" data-export data-readonly data-type="FrozenArray<XRHitTestResult>" id="dom-xrtransientinputhittestresult-results"><code><c- g>results</c-></code></dfn>;
};
</pre>
   <p>A <code class="idl"><a data-link-type="idl" href="#xrtransientinputhittestresult" id="ref-for-xrtransientinputhittestresult">XRTransientInputHitTestResult</a></code> contains array of result of a hit test for transient input, grouped by <code class="idl"><a data-link-type="idl">XRInputSource</a></code> <code class="idl"><a data-link-type="idl" href="#dom-xrtransientinputhittestresult-inputsource" id="ref-for-dom-xrtransientinputhittestresult-inputsource">inputSource</a></code>.</p>
   <p>The <code class="idl"><a data-link-type="idl" href="#dom-xrtransientinputhittestresult-inputsource" id="ref-for-dom-xrtransientinputhittestresult-inputsource①">inputSource</a></code> attribute contains an <code class="idl"><a data-link-type="idl">XRInputSource</a></code> that was used to compute the <code class="idl"><a data-link-type="idl" href="#dom-xrtransientinputhittestresult-results" id="ref-for-dom-xrtransientinputhittestresult-results">results</a></code> array.</p>
   <p>The <code class="idl"><a data-link-type="idl" href="#dom-xrtransientinputhittestresult-results" id="ref-for-dom-xrtransientinputhittestresult-results①">results</a></code> attribute contains an array of computed <code class="idl"><a data-link-type="idl" href="#xrhittestresult" id="ref-for-xrhittestresult⑥">XRHitTestResult</a></code>s.</p>
   <p>Each <code class="idl"><a data-link-type="idl" href="#xrtransientinputhittestresult" id="ref-for-xrtransientinputhittestresult①">XRTransientInputHitTestResult</a></code> has an associated <dfn class="dfn-paneled" data-dfn-for="XRTransientInputHitTestResult" data-dfn-type="dfn" data-noexport id="xrtransientinputhittestresult-frame">frame</dfn> which is an <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#xrframe-interface" id="ref-for-xrframe-interface②">XRFrame</a></code> for which the results were computed.</p>
   <div class="algorithm" data-algorithm="create-hit-test-result-for-transient-input">
    <p>In order to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="create-a-hit-test-result-for-transient-input">create a hit test result for transient input</dfn> given <code class="idl"><a data-link-type="idl">XRInputSource</a></code> <var>inputSource</var>, <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#xrframe-interface" id="ref-for-xrframe-interface③">XRFrame</a></code> <var>frame</var>, array of <code class="idl"><a data-link-type="idl" href="#enumdef-xrhittesttrackabletype" id="ref-for-enumdef-xrhittesttrackabletype⑧">XRHitTestTrackableType</a></code> <var>entityTypes</var>, and array of <a data-link-type="dfn" href="#native-hit-test-result" id="ref-for-native-hit-test-result①">native hit test results</a> <var>nativeResults</var>, the user agent MUST run the following steps:</p>
    <ol>
     <li data-md>
      <p>Let <var>hitTestResult</var> be a new <code class="idl"><a data-link-type="idl" href="#xrtransientinputhittestresult" id="ref-for-xrtransientinputhittestresult②">XRTransientInputHitTestResult</a></code>.</p>
     <li data-md>
      <p>Set <var>hitTestResult</var>’s <a data-link-type="dfn" href="#xrtransientinputhittestresult-frame" id="ref-for-xrtransientinputhittestresult-frame">frame</a> to <var>frame</var>.</p>
     <li data-md>
      <p>Set <var>hitTestResult</var>’s <code class="idl"><a data-link-type="idl" href="#dom-xrtransientinputhittestresult-inputsource" id="ref-for-dom-xrtransientinputhittestresult-inputsource②">inputSource</a></code> to <var>inputSource</var>.</p>
     <li data-md>
      <p>Let <var>results</var> be an empty array of <code class="idl"><a data-link-type="idl" href="#xrhittestresult" id="ref-for-xrhittestresult⑦">XRHitTestResult</a></code>s.</p>
     <li data-md>
      <p>For each <var>nativeResult</var> in <var>nativeResults</var>:</p>
      <ol>
       <li data-md>
        <p><a data-link-type="dfn" href="#create-a-hit-test-result" id="ref-for-create-a-hit-test-result">Create a hit test result</a> <var>result</var> from <var>frame</var>, <var>entityTypes</var>, and <var>nativeResult</var>.</p>
       <li data-md>
        <p>If <var>result</var> is <code>null</code>, continue to the next entry in <var>nativeResults</var>.</p>
       <li data-md>
        <p>Add <var>result</var> to <var>results</var> array.</p>
      </ol>
     <li data-md>
      <p>Set <var>hitTestResult</var>’s <code class="idl"><a data-link-type="idl" href="#dom-xrtransientinputhittestresult-results" id="ref-for-dom-xrtransientinputhittestresult-results②">results</a></code> to <var>results</var>.</p>
     <li data-md>
      <p>Return <var>hitTestResult</var>.</p>
    </ol>
   </div>
   <h2 class="heading settled" data-level="5" id="requesting-hit-test"><span class="secno">5. </span><span class="content">Requesting hit test</span><a class="self-link" href="#requesting-hit-test"></a></h2>
<pre class="idl highlight def"><c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://www.w3.org/TR/webxr/#xrsession-interface" id="ref-for-xrsession-interface②"><c- g>XRSession</c-></a> {
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#xrhittestsource" id="ref-for-xrhittestsource⑨"><c- n>XRHitTestSource</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-xrsession-requesthittestsource" id="ref-for-dom-xrsession-requesthittestsource"><c- g>requestHitTestSource</c-></a>(<a class="n" data-link-type="idl-name" href="#dictdef-xrhittestoptionsinit" id="ref-for-dictdef-xrhittestoptionsinit③"><c- n>XRHitTestOptionsInit</c-></a> <dfn class="idl-code" data-dfn-for="XRSession/requestHitTestSource(options)" data-dfn-type="argument" data-export id="dom-xrsession-requesthittestsource-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-xrsession-requesthittestsource-options-options"></a></dfn>);
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#xrtransientinputhittestsource" id="ref-for-xrtransientinputhittestsource⑨"><c- n>XRTransientInputHitTestSource</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-xrsession-requesthittestsourcefortransientinput" id="ref-for-dom-xrsession-requesthittestsourcefortransientinput"><c- g>requestHitTestSourceForTransientInput</c-></a>(<a class="n" data-link-type="idl-name" href="#dictdef-xrtransientinputhittestoptionsinit" id="ref-for-dictdef-xrtransientinputhittestoptionsinit③"><c- n>XRTransientInputHitTestOptionsInit</c-></a> <dfn class="idl-code" data-dfn-for="XRSession/requestHitTestSourceForTransientInput(options)" data-dfn-type="argument" data-export id="dom-xrsession-requesthittestsourcefortransientinput-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-xrsession-requesthittestsourcefortransientinput-options-options"></a></dfn>);
};
</pre>
   <p>The <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#xrsession-interface" id="ref-for-xrsession-interface③">XRSession</a></code> is extended to contain an associated <dfn class="dfn-paneled" data-dfn-for="XRSession" data-dfn-type="dfn" data-noexport id="xrsession-set-of-active-hit-test-sources">set of active hit test sources</dfn> that will be used when computing hit test results.</p>
   <p>The <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#xrsession-interface" id="ref-for-xrsession-interface④">XRSession</a></code> is extended to contain an associated <dfn class="dfn-paneled" data-dfn-for="XRSession" data-dfn-type="dfn" data-noexport id="xrsession-set-of-active-hit-test-sources-for-transient-input">set of active hit test sources for transient input</dfn> that will be used when computing hit test results for transient input.</p>
   <p>The application can <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="request-hit-test">request hit test</dfn> using <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#xrsession-interface" id="ref-for-xrsession-interface⑤">XRSession</a></code>'s <code class="idl"><a data-link-type="idl" href="#dom-xrsession-requesthittestsource" id="ref-for-dom-xrsession-requesthittestsource①">requestHitTestSource()</a></code> method.</p>
   <div class="algorithm" data-algorithm="request-hit-test-source">
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="XRSession" data-dfn-type="method" data-export id="dom-xrsession-requesthittestsource"><code>requestHitTestSource(<var>options</var>)</code></dfn> method, when invoked on an <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#xrsession-interface" id="ref-for-xrsession-interface⑥">XRSession</a></code> <var>session</var>, MUST run the following steps:</p>
    <ol>
     <li data-md>
      <p>Add <a data-link-type="dfn" href="#compute-all-hit-test-results" id="ref-for-compute-all-hit-test-results">compute all hit test results</a> algorithm to <var>session</var>’s <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xrsession-list-of-frame-updates" id="ref-for-xrsession-list-of-frame-updates">list of frame updates</a> if it is not already present there.</p>
     <li data-md>
      <p>Let <var>promise</var> be <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise">a new Promise</a>.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="#create-a-hit-test-source" id="ref-for-create-a-hit-test-source">Create a hit test source</a>, <var>hitTestSource</var>, with <var>session</var>, <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-xrhittestoptionsinit-space" id="ref-for-dom-xrhittestoptionsinit-space②">space</a></code>, <var>options</var>’ <a data-link-type="dfn" href="#xrhittestoptionsinit-effective-entitytypes" id="ref-for-xrhittestoptionsinit-effective-entitytypes①">effective entityTypes</a> and <var>options</var>’ <a data-link-type="dfn" href="#xrhittestoptionsinit-effective-offsetray" id="ref-for-xrhittestoptionsinit-effective-offsetray①">effective offsetRay</a>.</p>
     <li data-md>
      <p>If <var>hitTestSource</var> is <code>null</code>, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise">reject</a> <var>promise</var> with an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#operationerror" id="ref-for-operationerror">OperationError</a></code> and abort these steps.</p>
     <li data-md>
      <p>Store created <var>hitTestSource</var> in <var>session</var>’s <a data-link-type="dfn" href="#xrsession-set-of-active-hit-test-sources" id="ref-for-xrsession-set-of-active-hit-test-sources②">set of active hit test sources</a>.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#resolve-promise" id="ref-for-resolve-promise">Resolve</a> <var>promise</var> with created <var>hitTestSource</var>.</p>
    </ol>
   </div>
   <div class="algorithm" data-algorithm="request-hit-test-source-for-transient-input">
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="XRSession" data-dfn-type="method" data-export id="dom-xrsession-requesthittestsourcefortransientinput"><code>requestHitTestSourceForTransientInput(<var>options</var>)</code></dfn> method, when invoked on an <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#xrsession-interface" id="ref-for-xrsession-interface⑦">XRSession</a></code> <var>session</var>, MUST run the following steps:</p>
    <ol>
     <li data-md>
      <p>Add <a data-link-type="dfn" href="#compute-all-hit-test-results" id="ref-for-compute-all-hit-test-results①">compute all hit test results</a> algorithm to <var>session</var>’s <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xrsession-list-of-frame-updates" id="ref-for-xrsession-list-of-frame-updates①">list of frame updates</a> if it is not already present there.</p>
     <li data-md>
      <p>Let <var>promise</var> be <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise①">a new Promise</a>.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="#create-a-hit-test-source-for-transient-input" id="ref-for-create-a-hit-test-source-for-transient-input">Create a hit test source for transient input</a>, <var>hitTestSource</var>, with <var>session</var>, <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-xrtransientinputhittestoptionsinit-profile" id="ref-for-dom-xrtransientinputhittestoptionsinit-profile②">profile</a></code>, <var>options</var>’ <a data-link-type="dfn" href="#xrhittestoptionsinit-effective-entitytypes" id="ref-for-xrhittestoptionsinit-effective-entitytypes②">effective entityTypes</a> and <var>options</var>’ <a data-link-type="dfn" href="#xrhittestoptionsinit-effective-offsetray" id="ref-for-xrhittestoptionsinit-effective-offsetray②">effective offsetRay</a>.</p>
     <li data-md>
      <p>If <var>hitTestSource</var> is <code>null</code>, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise①">reject</a> <var>promise</var> with an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#operationerror" id="ref-for-operationerror①">OperationError</a></code> and abort these steps.</p>
     <li data-md>
      <p>Store created <var>hitTestSource</var> in <var>session</var>’s <a data-link-type="dfn" href="#xrsession-set-of-active-hit-test-sources-for-transient-input" id="ref-for-xrsession-set-of-active-hit-test-sources-for-transient-input②">set of active hit test sources for transient input</a>.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#resolve-promise" id="ref-for-resolve-promise①">Resolve</a> <var>promise</var> with created <var>hitTestSource</var>.</p>
    </ol>
   </div>
   <h2 class="heading settled" data-level="6" id="computing-hit-test-results"><span class="secno">6. </span><span class="content">Computing hit test results</span><a class="self-link" href="#computing-hit-test-results"></a></h2>
   <div class="algorithm" data-algorithm="compute-all-hit-test-results">
    <p>In order to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="compute-all-hit-test-results">compute all hit test results</dfn> for a given <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#xrframe-interface" id="ref-for-xrframe-interface④">XRFrame</a></code> <var>frame</var>, the user agent MUST perform the following steps:</p>
    <ol>
     <li data-md>
      <p>Invoke <a data-link-type="dfn" href="#compute-hit-test-results" id="ref-for-compute-hit-test-results">compute hit test results</a> algorithm with <var>frame</var>.</p>
     <li data-md>
      <p>Invoke <a data-link-type="dfn" href="#compute-hit-test-results-for-transient-input" id="ref-for-compute-hit-test-results-for-transient-input">compute hit test results for transient input</a> algorithm with <var>frame</var>.</p>
    </ol>
   </div>
   <div class="algorithm" data-algorithm="compute-hit-test-results">
    <p>In order to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="compute-hit-test-results">compute hit test results</dfn> for a given <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#xrframe-interface" id="ref-for-xrframe-interface⑤">XRFrame</a></code> <var>frame</var>, for each hit test source, <var>hitTestSource</var>, that is present in <code class="idl"><a data-link-type="idl">session</a></code>'s <a data-link-type="dfn" href="#xrsession-set-of-active-hit-test-sources" id="ref-for-xrsession-set-of-active-hit-test-sources③">set of active hit test sources</a>, the user agent MUST perform the following steps:</p>
    <ol>
     <li data-md>
      <p>Let <var>entityTypes</var> be the <var>hitTestSource</var>’s <a data-link-type="dfn" href="#xrhittestsource-entity-types" id="ref-for-xrhittestsource-entity-types①">entity types</a>.</p>
     <li data-md>
      <p>Let <var>session</var> be <var>frame</var>’s <code class="idl"><a data-link-type="idl">session</a></code>.</p>
     <li data-md>
      <p>Let <var>device</var> be the <var>session</var>’s <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xrsession-xr-device" id="ref-for-xrsession-xr-device①">XR device</a>.</p>
     <li data-md>
      <p>Query the <var>device</var>’s tracking system for <var>hitTestSource</var>’s <a data-link-type="dfn" href="#xrhittestsource-native-origin" id="ref-for-xrhittestsource-native-origin①">native origin</a>'s latest <var>coordinates</var>.</p>
     <li data-md>
      <p>Interpret <var>hitTestSource</var>’s <a data-link-type="dfn" href="#xrhittestsource-offset-ray" id="ref-for-xrhittestsource-offset-ray①">offset ray</a>, <var>offsetRay</var>, as if expressed relative to <var>coordinates</var> and using that interpretation, perform <a data-link-type="dfn" href="#native-hit-test" id="ref-for-native-hit-test">native hit test</a> obtaining <a data-link-type="dfn" href="#native-hit-test-result" id="ref-for-native-hit-test-result②">native hit test results</a> <var>nativeResults</var>.</p>
     <li data-md>
      <p>Let <var>hitTestResults</var> be an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list">list</a>.</p>
     <li data-md>
      <p>For each native hit test result <var>nativeResult</var> in <var>nativeResults</var>, perform the following steps:</p>
      <ol>
       <li data-md>
        <p><a data-link-type="dfn" href="#create-a-hit-test-result" id="ref-for-create-a-hit-test-result①">Create a hit test result</a>, <var>hitTestResult</var> from <var>frame</var>, <var>entityTypes</var>, and <var>nativeResult</var>.</p>
       <li data-md>
        <p>If <var>hitTestResult</var> is <code>null</code>, continue to the next entry in <var>nativeResults</var>.</p>
       <li data-md>
        <p>Add <var>hitTestResult</var> to <var>hitTestResults</var> such that the list remains sorted by the <a data-link-type="dfn" href="#distance-along-the-ray" id="ref-for-distance-along-the-ray">distance along the ray</a> from <var>offsetRay</var> to <var>nativeResult</var>.</p>
      </ol>
     <li data-md>
      <p>Store <var>hitTestResults</var> in <var>frame</var>’s <a data-link-type="dfn" href="#xrframe-map-of-hit-test-sources-to-hit-test-results" id="ref-for-xrframe-map-of-hit-test-sources-to-hit-test-results">map of hit test sources to hit test results</a> under the <var>hitTestSource</var> key.</p>
    </ol>
   </div>
   <div class="algorithm" data-algorithm="compute-hit-test-results-for-transient-input">
    <p>In order to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="compute-hit-test-results-for-transient-input">compute hit test results for transient input</dfn> for a given <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#xrframe-interface" id="ref-for-xrframe-interface⑥">XRFrame</a></code> <var>frame</var>, for each hit test source, <var>hitTestSource</var>, that is present in <code class="idl"><a data-link-type="idl">session</a></code>'s <a data-link-type="dfn" href="#xrsession-set-of-active-hit-test-sources-for-transient-input" id="ref-for-xrsession-set-of-active-hit-test-sources-for-transient-input③">set of active hit test sources for transient input</a>, the user agent MUST perform the following steps:</p>
    <ol>
     <li data-md>
      <p>Let <var>entityTypes</var> be the <var>hitTestSource</var>’s <a data-link-type="dfn" href="#xrtransientinputhittestsource-entity-types" id="ref-for-xrtransientinputhittestsource-entity-types①">entity types</a>.</p>
     <li data-md>
      <p>Let <var>session</var> be <var>frame</var>’s <code class="idl"><a data-link-type="idl">session</a></code>.</p>
     <li data-md>
      <p>Let <var>device</var> be the <var>session</var>’s <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xrsession-xr-device" id="ref-for-xrsession-xr-device②">XR device</a>.</p>
     <li data-md>
      <p>Let <var>candidateInputSources</var> be a set of all <var>session</var>’s input sources contained in <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#list-of-active-xr-input-sources" id="ref-for-list-of-active-xr-input-sources">list of active XR input sources</a> that are considered transient.</p>
     <li data-md>
      <p>Let <var>matchingInputSources</var> be a set of all input sources contained in <var>candidateInputSources</var> whose <code class="idl"><a data-link-type="idl">profiles</a></code> array contain an entry equal to <var>hitTestSource</var>’s <a data-link-type="dfn" href="#xrtransientinputhittestsource-profile" id="ref-for-xrtransientinputhittestsource-profile①">profile</a>.</p>
     <li data-md>
      <p>Let <var>hitTestResults</var> be an empty array of XRTransientInputHitTestResults.</p>
     <li data-md>
      <p>For each transient input source <var>inputSource</var> in <var>matchingInputSources</var>:</p>
      <ol>
       <li data-md>
        <p>Query the <var>device</var>’s tracking system for <var>inputSource</var>’s <code class="idl"><a data-link-type="idl">targetRaySpace</a></code>'s <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xrspace-native-origin" id="ref-for-xrspace-native-origin④">native origin</a>'s latest <var>coordinates</var>.</p>
       <li data-md>
        <p>Interpret <var>hitTestSource</var>’s <a data-link-type="dfn" href="#xrtransientinputhittestsource-offset-ray" id="ref-for-xrtransientinputhittestsource-offset-ray①">offset ray</a>, as if expressed relative to <var>coordinates</var> and using that interpretation, perform <a data-link-type="dfn" href="#native-hit-test" id="ref-for-native-hit-test①">native hit test</a> obtaining <a data-link-type="dfn" href="#native-hit-test-result" id="ref-for-native-hit-test-result③">native hit test results</a> <var>nativeResults</var>.</p>
       <li data-md>
        <p><a data-link-type="dfn" href="#create-a-hit-test-result-for-transient-input" id="ref-for-create-a-hit-test-result-for-transient-input">Create a hit test result for transient input</a>, <var>hitTestResult</var> from <var>frame</var>, <var>inputSource</var>, <var>entityTypes</var>, and <var>nativeResults</var>.</p>
       <li data-md>
        <p>Add <var>hitTestResult</var> to <var>hitTestResults</var> array.</p>
      </ol>
     <li data-md>
      <p>Store <var>hitTestResults</var> in <var>frame</var>’s <a data-link-type="dfn" href="#xrframe-map-of-hit-test-sources-to-hit-test-results-for-transient-input" id="ref-for-xrframe-map-of-hit-test-sources-to-hit-test-results-for-transient-input">map of hit test sources to hit test results for transient input</a> under the <var>hitTestSource</var> key.</p>
    </ol>
   </div>
   <h2 class="heading settled" data-level="7" id="obtaining-hit-test-results"><span class="secno">7. </span><span class="content">Obtaining hit test results</span><a class="self-link" href="#obtaining-hit-test-results"></a></h2>
<pre class="idl highlight def"><c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://www.w3.org/TR/webxr/#xrframe-interface" id="ref-for-xrframe-interface⑦"><c- g>XRFrame</c-></a> {
  <c- b>FrozenArray</c->&lt;<a class="n" data-link-type="idl-name" href="#xrhittestresult" id="ref-for-xrhittestresult⑧"><c- n>XRHitTestResult</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-xrframe-gethittestresults" id="ref-for-dom-xrframe-gethittestresults"><c- g>getHitTestResults</c-></a>(<a class="n" data-link-type="idl-name" href="#xrhittestsource" id="ref-for-xrhittestsource①⓪"><c- n>XRHitTestSource</c-></a> <dfn class="idl-code" data-dfn-for="XRFrame/getHitTestResults(hitTestSource)" data-dfn-type="argument" data-export id="dom-xrframe-gethittestresults-hittestsource-hittestsource"><code><c- g>hitTestSource</c-></code><a class="self-link" href="#dom-xrframe-gethittestresults-hittestsource-hittestsource"></a></dfn>);
  <c- b>FrozenArray</c->&lt;<a class="n" data-link-type="idl-name" href="#xrtransientinputhittestresult" id="ref-for-xrtransientinputhittestresult③"><c- n>XRTransientInputHitTestResult</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-xrframe-gethittestresultsfortransientinput" id="ref-for-dom-xrframe-gethittestresultsfortransientinput"><c- g>getHitTestResultsForTransientInput</c-></a>(<a class="n" data-link-type="idl-name" href="#xrtransientinputhittestsource" id="ref-for-xrtransientinputhittestsource①⓪"><c- n>XRTransientInputHitTestSource</c-></a> <dfn class="idl-code" data-dfn-for="XRFrame/getHitTestResultsForTransientInput(hitTestSource)" data-dfn-type="argument" data-export id="dom-xrframe-gethittestresultsfortransientinput-hittestsource-hittestsource"><code><c- g>hitTestSource</c-></code><a class="self-link" href="#dom-xrframe-gethittestresultsfortransientinput-hittestsource-hittestsource"></a></dfn>);
};
</pre>
   <p>The <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#xrframe-interface" id="ref-for-xrframe-interface⑧">XRFrame</a></code> is extended to contain an associated <dfn class="dfn-paneled" data-dfn-for="XRFrame" data-dfn-type="dfn" data-noexport id="xrframe-map-of-hit-test-sources-to-hit-test-results">map of hit test sources to hit test results</dfn> that stores a mapping from <code class="idl"><a data-link-type="idl" href="#xrhittestsource" id="ref-for-xrhittestsource①①">XRHitTestSource</a></code> to an array of <a class="idl-code" data-link-type="interface" href="#xrhittestresult" id="ref-for-xrhittestresult⑨">XRHitTestResults</a>.</p>
   <p>The <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#xrframe-interface" id="ref-for-xrframe-interface⑨">XRFrame</a></code> is extended to contain an associated <dfn class="dfn-paneled" data-dfn-for="XRFrame" data-dfn-type="dfn" data-noexport id="xrframe-map-of-hit-test-sources-to-hit-test-results-for-transient-input">map of hit test sources to hit test results for transient input</dfn> that stores a mapping from <code class="idl"><a data-link-type="idl" href="#xrtransientinputhittestsource" id="ref-for-xrtransientinputhittestsource①①">XRTransientInputHitTestSource</a></code> to an array of <a class="idl-code" data-link-type="interface" href="#xrtransientinputhittestresult" id="ref-for-xrtransientinputhittestresult④">XRTransientInputHitTestResults</a>.</p>
   <p>The application can <dfn data-dfn-type="dfn" data-noexport id="obtain-hit-test-results">obtain hit test results<a class="self-link" href="#obtain-hit-test-results"></a></dfn> from an <code class="idl"><a data-link-type="idl" href="#xrhittestsource" id="ref-for-xrhittestsource①②">XRHitTestSource</a></code> by using <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#xrframe-interface" id="ref-for-xrframe-interface①⓪">XRFrame</a></code>'s <code class="idl"><a data-link-type="idl" href="#dom-xrframe-gethittestresults" id="ref-for-dom-xrframe-gethittestresults①">getHitTestResults()</a></code> method.</p>
   <div class="algorithm" data-algorithm="obtain-hit-test-results">
    <p>When the <dfn class="dfn-paneled idl-code" data-dfn-for="XRFrame" data-dfn-type="method" data-export id="dom-xrframe-gethittestresults"><code>getHitTestResults(<var>hitTestSource</var>)</code></dfn> method, when invoked on an <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#xrframe-interface" id="ref-for-xrframe-interface①①">XRFrame</a></code> <var>frame</var>, the user agent MUST run the following steps:</p>
    <ol>
     <li data-md>
      <p>If <var>frame</var>’s <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xrframe-active" id="ref-for-xrframe-active①">active</a> boolean is <code>false</code>, throw an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror③">InvalidStateError</a></code> and abort these steps.</p>
     <li data-md>
      <p>Check that the entry for <var>hitTestSource</var> is present in <var>frame</var>’s <a data-link-type="dfn" href="#xrframe-map-of-hit-test-sources-to-hit-test-results" id="ref-for-xrframe-map-of-hit-test-sources-to-hit-test-results①">map of hit test sources to hit test results</a>. If the entry is not present, throw an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror④">InvalidStateError</a></code> and abort these steps.</p>
     <li data-md>
      <p>Look up an entry for <var>hitTestSource</var> in <var>frame</var>’s <a data-link-type="dfn" href="#xrframe-map-of-hit-test-sources-to-hit-test-results" id="ref-for-xrframe-map-of-hit-test-sources-to-hit-test-results②">map of hit test sources to hit test results</a> and assign it to <var>results</var>.</p>
     <li data-md>
      <p>Return <var>results</var>.</p>
    </ol>
   </div>
   <p>The application can <dfn data-dfn-type="dfn" data-noexport id="obtain-hit-test-results-for-transient-input">obtain hit test results for transient input<a class="self-link" href="#obtain-hit-test-results-for-transient-input"></a></dfn> from an <code class="idl"><a data-link-type="idl" href="#xrtransientinputhittestsource" id="ref-for-xrtransientinputhittestsource①②">XRTransientInputHitTestSource</a></code> by using <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#xrframe-interface" id="ref-for-xrframe-interface①②">XRFrame</a></code>'s <code class="idl"><a data-link-type="idl" href="#dom-xrframe-gethittestresultsfortransientinput" id="ref-for-dom-xrframe-gethittestresultsfortransientinput①">getHitTestResultsForTransientInput()</a></code> method.</p>
   <div class="algorithm" data-algorithm="obtain-hit-test-results-for-transient-input">
    <p>When the <dfn class="dfn-paneled idl-code" data-dfn-for="XRFrame" data-dfn-type="method" data-export id="dom-xrframe-gethittestresultsfortransientinput"><code>getHitTestResultsForTransientInput(<var>hitTestSource</var>)</code></dfn> method, when invoked on an <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#xrframe-interface" id="ref-for-xrframe-interface①③">XRFrame</a></code> <var>frame</var>, the user agent MUST run the following steps:</p>
    <ol>
     <li data-md>
      <p>If <var>frame</var>’s <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xrframe-active" id="ref-for-xrframe-active②">active</a> boolean is <code>false</code>, throw an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror⑤">InvalidStateError</a></code> and abort these steps.</p>
     <li data-md>
      <p>Check that the entry for <var>hitTestSource</var> is present in <var>frame</var>’s <a data-link-type="dfn" href="#xrframe-map-of-hit-test-sources-to-hit-test-results-for-transient-input" id="ref-for-xrframe-map-of-hit-test-sources-to-hit-test-results-for-transient-input①">map of hit test sources to hit test results for transient input</a>. If the entry is not present, throw an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror⑥">InvalidStateError</a></code> and abort these steps.</p>
     <li data-md>
      <p>Look up an entry for <var>hitTestSource</var> in <var>frame</var>’s <a data-link-type="dfn" href="#xrframe-map-of-hit-test-sources-to-hit-test-results-for-transient-input" id="ref-for-xrframe-map-of-hit-test-sources-to-hit-test-results-for-transient-input②">map of hit test sources to hit test results for transient input</a> and assign it to <var>results</var>.</p>
     <li data-md>
      <p>Return <var>results</var>.</p>
    </ol>
   </div>
   <h2 class="heading settled" data-level="8" id="geometric-primitives"><span class="secno">8. </span><span class="content">Geometric primitives</span><a class="self-link" href="#geometric-primitives"></a></h2>
   <h3 class="heading settled" data-level="8.1" id="xrray-interface"><span class="secno">8.1. </span><span class="content">XRRay</span><a class="self-link" href="#xrray-interface"></a></h3>
   <p>An <code class="idl"><a data-link-type="idl" href="#xrray" id="ref-for-xrray⑧">XRRay</a></code> is a geometric ray described by an <code class="idl"><a data-link-type="idl" href="#dom-xrray-origin" id="ref-for-dom-xrray-origin">origin</a></code> point and <code class="idl"><a data-link-type="idl" href="#dom-xrray-direction" id="ref-for-dom-xrray-direction">direction</a></code> vector.</p>
   <p>An <code class="idl"><a data-link-type="idl" href="#xrray" id="ref-for-xrray⑨">XRRay</a></code> contains a <dfn class="dfn-paneled" data-dfn-for="XRRay" data-dfn-type="dfn" data-noexport id="xrray-matrix">matrix</dfn> which is a <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#matrix" id="ref-for-matrix">matrix</a>.</p>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext④"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed④"><c- g>Exposed</c-></a>=<c- n>Window</c->,
 <a class="idl-code" data-link-type="constructor" href="#dom-xrray-xrray" id="ref-for-dom-xrray-xrray②"><c- g>Constructor</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="https://drafts.fxtf.org/geometry-1/#dictdef-dompointinit" id="ref-for-dictdef-dompointinit"><c- n>DOMPointInit</c-></a> <dfn class="idl-code" data-dfn-for="XRRay/XRRay(origin, direction)" data-dfn-type="argument" data-export id="dom-xrray-xrray-origin-direction-origin"><code><c- g>origin</c-></code><a class="self-link" href="#dom-xrray-xrray-origin-direction-origin"></a></dfn>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="https://drafts.fxtf.org/geometry-1/#dictdef-dompointinit" id="ref-for-dictdef-dompointinit①"><c- n>DOMPointInit</c-></a> <dfn class="idl-code" data-dfn-for="XRRay/XRRay(origin, direction)" data-dfn-type="argument" data-export id="dom-xrray-xrray-origin-direction-direction"><code><c- g>direction</c-></code><a class="self-link" href="#dom-xrray-xrray-origin-direction-direction"></a></dfn>),
 <a class="idl-code" data-link-type="constructor" href="#dom-xrray-xrray-transform" id="ref-for-dom-xrray-xrray-transform"><c- g>Constructor</c-></a>(<a class="n" data-link-type="idl-name" href="https://www.w3.org/TR/webxr/#xrrigidtransform-interface" id="ref-for-xrrigidtransform-interface"><c- n>XRRigidTransform</c-></a> <dfn class="idl-code" data-dfn-for="XRRay/XRRay(transform)" data-dfn-type="argument" data-export id="dom-xrray-xrray-transform-transform"><code><c- g>transform</c-></code><a class="self-link" href="#dom-xrray-xrray-transform-transform"></a></dfn>)]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="xrray"><code><c- g>XRRay</c-></code></dfn> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject①"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://drafts.fxtf.org/geometry-1/#dompointreadonly" id="ref-for-dompointreadonly"><c- n>DOMPointReadOnly</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMPointReadOnly" href="#dom-xrray-origin" id="ref-for-dom-xrray-origin①"><c- g>origin</c-></a>;
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject②"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://drafts.fxtf.org/geometry-1/#dompointreadonly" id="ref-for-dompointreadonly①"><c- n>DOMPointReadOnly</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMPointReadOnly" href="#dom-xrray-direction" id="ref-for-dom-xrray-direction①"><c- g>direction</c-></a>;
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject③"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-Float32Array" id="ref-for-idl-Float32Array"><c- b>Float32Array</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="Float32Array" href="#dom-xrray-matrix" id="ref-for-dom-xrray-matrix"><c- g>matrix</c-></a>;
};
</pre>
   <div class="algorithm" data-algorithm="construct-ray-origin-direction">
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="XRRay" data-dfn-type="constructor" data-export data-lt="XRRay(origin, direction)|XRRay(origin)|XRRay()" id="dom-xrray-xrray"><code>XRRay(<var>origin</var>, <var>direction</var>)</code></dfn> constructor MUST perform the following steps when invoked:</p>
    <ol>
     <li data-md>
      <p>Let <var>ray</var> be a new <code class="idl"><a data-link-type="idl" href="#xrray" id="ref-for-xrray①⓪">XRRay</a></code>.</p>
     <li data-md>
      <p>Initialize <var>ray</var>’s <code class="idl"><a data-link-type="idl" href="#dom-xrray-origin" id="ref-for-dom-xrray-origin②">origin</a></code> to <code>{ x: 0.0, y: 0.0, z: 0.0, w: 1.0 }</code>.</p>
     <li data-md>
      <p>Initialize <var>ray</var>’s <code class="idl"><a data-link-type="idl" href="#dom-xrray-direction" id="ref-for-dom-xrray-direction②">direction</a></code> to <code>{ x: 0.0, y: 0.0, z: -1.0, w: 0.0 }</code>.</p>
     <li data-md>
      <p>If <var>origin</var> was set, initialize <var>ray</var>’s <code class="idl"><a data-link-type="idl" href="#dom-xrray-origin" id="ref-for-dom-xrray-origin③">origin</a></code>’s <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-x" id="ref-for-dom-dompointreadonly-x">x</a></code> value to <var>origin</var>’s x dictionary member, <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-y" id="ref-for-dom-dompointreadonly-y">y</a></code> value to <var>origin</var>’s y dictionary member, and <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-z" id="ref-for-dom-dompointreadonly-z">z</a></code> value to <var>origin</var>’s z dictionary member.</p>
     <li data-md>
      <p>If <var>direction</var> was set, initialize <var>ray</var>’s <code class="idl"><a data-link-type="idl" href="#dom-xrray-direction" id="ref-for-dom-xrray-direction③">direction</a></code>’s <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-x" id="ref-for-dom-dompointreadonly-x①">x</a></code> value to <var>direction</var>’s x dictionary member, <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-y" id="ref-for-dom-dompointreadonly-y①">y</a></code> value to <var>direction</var>’s y dictionary member, and <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-z" id="ref-for-dom-dompointreadonly-z①">z</a></code> value to <var>direction</var>’s z dictionary member.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#normalize" id="ref-for-normalize">Normalize</a> the <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-x" id="ref-for-dom-dompointreadonly-x②">x</a></code>, <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-y" id="ref-for-dom-dompointreadonly-y②">y</a></code>, and <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-z" id="ref-for-dom-dompointreadonly-z②">z</a></code> components of <var>ray</var>’s <code class="idl"><a data-link-type="idl" href="#dom-xrray-direction" id="ref-for-dom-xrray-direction④">direction</a></code>.</p>
     <li data-md>
      <p>Initialize <var>ray</var>’s <a data-link-type="dfn" href="#xrray-matrix" id="ref-for-xrray-matrix">matrix</a> to <code>null</code>.</p>
     <li data-md>
      <p>Return <var>ray</var>.</p>
    </ol>
   </div>
   <div class="algorithm" data-algorithm="construct-ray-transform">
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="XRRay" data-dfn-type="constructor" data-export id="dom-xrray-xrray-transform"><code>XRRay(<var>transform</var>)</code></dfn> constructor MUST perform the following steps when invoked:</p>
    <ol>
     <li data-md>
      <p>Let <var>ray</var> be a new <code class="idl"><a data-link-type="idl" href="#xrray" id="ref-for-xrray①①">XRRay</a></code>.</p>
     <li data-md>
      <p>Initialize <var>ray</var>’s <code class="idl"><a data-link-type="idl" href="#dom-xrray-origin" id="ref-for-dom-xrray-origin④">origin</a></code> to <code>{ x: 0.0, y: 0.0, z: 0.0, w: 1.0 }</code>.</p>
     <li data-md>
      <p>Initialize <var>ray</var>’s <code class="idl"><a data-link-type="idl" href="#dom-xrray-direction" id="ref-for-dom-xrray-direction⑤">direction</a></code> to <code>{ x: 0.0, y: 0.0, z: -1.0, w: 0.0 }</code>.</p>
     <li data-md>
      <p>Transform <var>ray</var>’s <code class="idl"><a data-link-type="idl" href="#dom-xrray-origin" id="ref-for-dom-xrray-origin⑤">origin</a></code> by premultiplying the <var>transform</var>’s <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#dom-xrrigidtransform-matrix" id="ref-for-dom-xrrigidtransform-matrix">matrix</a></code> and set <var>ray</var> to the result.</p>
     <li data-md>
      <p>Transform <var>ray</var>’s <code class="idl"><a data-link-type="idl" href="#dom-xrray-direction" id="ref-for-dom-xrray-direction⑥">direction</a></code> by premultiplying the <var>transform</var>’s <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webxr/#dom-xrrigidtransform-matrix" id="ref-for-dom-xrrigidtransform-matrix①">matrix</a></code> and set <var>ray</var> to the result.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#normalize" id="ref-for-normalize①">Normalize</a> the <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-x" id="ref-for-dom-dompointreadonly-x③">x</a></code>, <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-y" id="ref-for-dom-dompointreadonly-y③">y</a></code>, and <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-z" id="ref-for-dom-dompointreadonly-z③">z</a></code> components of <var>ray</var>’s <code class="idl"><a data-link-type="idl" href="#dom-xrray-direction" id="ref-for-dom-xrray-direction⑦">direction</a></code>.</p>
     <li data-md>
      <p>Return <var>ray</var>.</p>
    </ol>
   </div>
   <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="XRRay" data-dfn-type="attribute" data-export id="dom-xrray-origin"><code>origin</code></dfn> attribute defines the 3-dimensional point in space that the ray originates from, given in meters. The <code class="idl"><a data-link-type="idl" href="#dom-xrray-origin" id="ref-for-dom-xrray-origin⑥">origin</a></code>'s <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-w" id="ref-for-dom-dompointreadonly-w">w</a></code> attribute MUST be <code>1.0</code>.</p>
   <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="XRRay" data-dfn-type="attribute" data-export id="dom-xrray-direction"><code>direction</code></dfn> attribute defines the ray’s 3-dimensional directional vector. The <code class="idl"><a data-link-type="idl" href="#dom-xrray-direction" id="ref-for-dom-xrray-direction⑧">direction</a></code>'s <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-w" id="ref-for-dom-dompointreadonly-w①">w</a></code> attribute MUST be <code>0.0</code> and the vector MUST be normalized to have a length of <code>1.0</code>.</p>
   <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="XRRay" data-dfn-type="attribute" data-export id="dom-xrray-matrix"><code>matrix</code></dfn> attribute is a <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#matrix" id="ref-for-matrix①">matrix</a> which represents a transform that can be used to position objects along the <code class="idl"><a data-link-type="idl" href="#xrray" id="ref-for-xrray①②">XRRay</a></code>. It is a transform from a ray originating at <code>[0, 0, 0]</code> and extending down the negative Z axis to the ray described by the <code class="idl"><a data-link-type="idl" href="#xrray" id="ref-for-xrray①③">XRRay</a></code>'s <code class="idl"><a data-link-type="idl" href="#dom-xrray-origin" id="ref-for-dom-xrray-origin⑦">origin</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-xrray-direction" id="ref-for-dom-xrray-direction⑨">direction</a></code>. Such a matrix MUST be one that has a rotation component which leaves any vector perpendicular to <code class="idl"><a data-link-type="idl" href="#dom-xrray-direction" id="ref-for-dom-xrray-direction①⓪">direction</a></code> and the <code>Z</code> axis unchanged. This attribute MUST be computed by <a data-link-type="dfn" href="#xrray-obtain-the-matrix" id="ref-for-xrray-obtain-the-matrix">obtaining the matrix</a> for the <code class="idl"><a data-link-type="idl" href="#xrray" id="ref-for-xrray①④">XRRay</a></code>. This attribute SHOULD be lazily evaluated.</p>
   <p class="note" role="note"><span>Note:</span> The <code class="idl"><a data-link-type="idl" href="#xrray" id="ref-for-xrray①⑤">XRRay</a></code>'s <code class="idl"><a data-link-type="idl" href="#dom-xrray-matrix" id="ref-for-dom-xrray-matrix①">matrix</a></code> can be used to easily position graphical representations of the ray when rendering.</p>
   <div class="algorithm" data-algorithm="obtain-ray-matrix">
    <p>To <dfn class="dfn-paneled" data-dfn-for="XRRay" data-dfn-type="dfn" data-noexport id="xrray-obtain-the-matrix">obtain the matrix</dfn> for a given <code class="idl"><a data-link-type="idl" href="#xrray" id="ref-for-xrray①⑥">XRRay</a></code> <var>ray</var></p>
    <ol>
     <li data-md>
      <p>If <var>ray</var>’s <a data-link-type="dfn" href="#xrray-matrix" id="ref-for-xrray-matrix①">matrix</a> is not <code>null</code>, perform the following steps:</p>
      <ol>
       <li data-md>
        <p>If the operation <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-isdetachedbuffer" id="ref-for-sec-isdetachedbuffer">IsDetachedBuffer</a></code> on <a data-link-type="dfn" href="#xrray-matrix" id="ref-for-xrray-matrix②">matrix</a> is <code>false</code>, return <var>ray</var>’s <a data-link-type="dfn" href="#xrray-matrix" id="ref-for-xrray-matrix③">matrix</a>.</p>
      </ol>
     <li data-md>
      <p>Let <var>z</var> be the vector <code>[0, 0, -1]</code>.</p>
     <li data-md>
      <p>Let <var>axis</var> be the vector cross product of <var>z</var> and <var>ray</var>’s <code class="idl"><a data-link-type="idl" href="#dom-xrray-direction" id="ref-for-dom-xrray-direction①①">direction</a></code>, <code>z × direction</code>.</p>
     <li data-md>
      <p>Let <var>cos_angle</var> be the scalar dot product of <var>z</var> and <var>ray</var>’s <code class="idl"><a data-link-type="idl" href="#dom-xrray-direction" id="ref-for-dom-xrray-direction①②">direction</a></code>, <code>z · direction</code>.</p>
     <li data-md>
      <p>Set <var>rotation</var> based on the following:</p>
      <dl class="switch">
       <dt> If <var>cos_angle</var> is greater than -1 and less than 1 
       <dd> Set <var>rotation</var> to the rotation matrix representing a right handed planar rotation around <var>axis</var> by <code>arccos(cos_angle)</code>. 
       <dt> Else, if <var>cos_angle</var> is -1 
       <dd> Set <var>rotation</var> to the rotation matrix representing a right handed planar rotation around vector <code>[1, 0, 0]</code> by <code>arccos(cos_angle)</code>. 
       <dt> Else 
       <dd> Set <var>rotation</var> to an identity matrix. 
      </dl>
     <li data-md>
      <p>Let <var>translation</var> be the translation matrix with components corresponding to <var>ray</var>’s <code class="idl"><a data-link-type="idl" href="#dom-xrray-origin" id="ref-for-dom-xrray-origin⑧">origin</a></code>.</p>
     <li data-md>
      <p>Let <var>matrix</var> be the result of premultiplying <var>rotation</var> from the left onto <var>translation</var> (i.e. <code>translation * rotation</code>) in column-vector notation.</p>
     <li data-md>
      <p>Set <var>ray</var>’s <a data-link-type="dfn" href="#xrray-matrix" id="ref-for-xrray-matrix④">matrix</a> to <var>matrix</var>.</p>
     <li data-md>
      <p>Return <var>matrix</var>.</p>
    </ol>
   </div>
   <div class="algorithm" data-algorithm="distance-along-ray">
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="distance-along-the-ray">distance along the ray</dfn>, <var>distance</var>, from <code class="idl"><a data-link-type="idl" href="#xrray" id="ref-for-xrray①⑦">XRRay</a></code> <var>ray</var> to any entity <var>entity</var> is defined such that <code><var>ray</var>.origin + <var>ray</var>.direction * <var>distance</var></code> results in a point beloning to the entity <var>entity</var>, <var>distance</var> is non-negative, and there does not exist a smaller value of <var>distance</var> for the above predicate to still hold. It is up to the <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xr-device" id="ref-for-xr-device①">XR device</a> to define the meaning of "point belonging to an entity".</p>
   </div>
   <h2 class="heading settled" data-level="9" id="native-device-concepts"><span class="secno">9. </span><span class="content">Native device concepts</span><a class="self-link" href="#native-device-concepts"></a></h2>
   <section class="non-normative">
    <p>User agents implementing hit test API must have a way of obtaining information about user’s environment from underlying XR device. This section attempts to describe requirements and concepts related to native capabilities of the device and is by neccesity sufficiently under-specified to leave ample room for different underlying frameworks / devices.</p>
   </section>
   <h3 class="heading settled" data-level="9.1" id="native-hit-test-section"><span class="secno">9.1. </span><span class="content">Native hit test</span><a class="self-link" href="#native-hit-test-section"></a></h3>
   <p>In this specification it is assumed that <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xr-device" id="ref-for-xr-device②">XR device</a> exposes a way for the user agent to perform a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="native-hit-test">native hit test</dfn> that satisfies the following requirements:</p>
   <ul>
    <li data-md>
     <p>Accepts a 3D ray that will be tested against user’s environment.</p>
    <li data-md>
     <p>Returns a collection of 3D poses representing intersection points of the passed in ray with user’s environment. Each entry in the collection should also contain information about the type of the native entity that was used to obtain that native result and enough information to enable the user agent to compute surface normal to the user’s environment at the intersection point.</p>
   </ul>
   <p class="note" role="note"><span>Note:</span> For devices that do not expose the hit test functionality natively, it might still be possible for user agents to implement this specification by leveraging other ways of obtaining the information about user’s environment that might be exposed by the XR device.</p>
   <h3 class="heading settled" data-level="9.2" id="native-entity-type-section"><span class="secno">9.2. </span><span class="content">Native entity type</span><a class="self-link" href="#native-entity-type-section"></a></h3>
   <p><a data-link-type="dfn" href="#native-hit-test-result" id="ref-for-native-hit-test-result④">Native hit test results</a> returned by <a data-link-type="dfn" href="https://www.w3.org/TR/webxr/#xr-device" id="ref-for-xr-device③">XR device</a> should contain information about the <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="native entity type" data-noexport id="native-entity-type">type of the entity</dfn> used to compute the result. Such native types might consist of, but not be limited to:</p>
   <ul>
    <li data-md>
     <p>Point - signifies that hit test result was computed based on characteristic points found in user’s environment.</p>
    <li data-md>
     <p>Plane - signifies that hit test result was computed based on planes detected in user’s environment.</p>
    <li data-md>
     <p>Mesh - signifies that the hit test result was computed based on meshes detected in user’s environment.</p>
   </ul>
   <div class="algorithm" data-algorithm="convert-native-type-to-trackable-type">
    <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="convert-from-native-entity-type">convert from native entity type</dfn> into <code class="idl"><a data-link-type="idl" href="#enumdef-xrhittesttrackabletype" id="ref-for-enumdef-xrhittesttrackabletype⑨">XRHitTestTrackableType</a></code>, the user agent MUST run the following steps:</p>
    <ol>
     <li data-md>
      <p>Let <var>nativeEntityType</var> be the native entity type to be converted.</p>
     <li data-md>
      <p>Let <var>entityType</var> be a new <code class="idl"><a data-link-type="idl" href="#enumdef-xrhittesttrackabletype" id="ref-for-enumdef-xrhittesttrackabletype①⓪">XRHitTestTrackableType</a></code>.</p>
     <li data-md>
      <p>Initialize <var>entityType</var> as follows:</p>
      <dl class="switch">
       <dt>If <var>nativeEntityType</var> contains type that corresponds to <code class="idl"><a data-link-type="idl" href="#dom-xrhittesttrackabletype-point" id="ref-for-dom-xrhittesttrackabletype-point①">"point"</a></code>
       <dd>Set <var>entityType</var> to <code class="idl"><a data-link-type="idl" href="#dom-xrhittesttrackabletype-point" id="ref-for-dom-xrhittesttrackabletype-point②">"point"</a></code>.
       <dt>Else, if <var>nativeEntityType</var> contains type that corresponds to <code class="idl"><a data-link-type="idl" href="#dom-xrhittesttrackabletype-plane" id="ref-for-dom-xrhittesttrackabletype-plane③">"plane"</a></code>
       <dd>Set <var>entityType</var> to <code class="idl"><a data-link-type="idl" href="#dom-xrhittesttrackabletype-plane" id="ref-for-dom-xrhittesttrackabletype-plane④">"plane"</a></code>.
       <dt>Else, if <var>nativeEntityType</var> contains type that corresponds to <code class="idl"><a data-link-type="idl" href="#dom-xrhittesttrackabletype-mesh" id="ref-for-dom-xrhittesttrackabletype-mesh①">"mesh"</a></code>
       <dd>Set <var>entityType</var> to <code class="idl"><a data-link-type="idl" href="#dom-xrhittesttrackabletype-mesh" id="ref-for-dom-xrhittesttrackabletype-mesh②">"mesh"</a></code>.
       <dt>Else
       <dd>Set <var>entityType</var> to <code>null</code>
      </dl>
     <li data-md>
      <p>Return <var>entityType</var>.</p>
    </ol>
   </div>
   <h3 class="heading settled" data-level="9.3" id="native-hit-test-result-section"><span class="secno">9.3. </span><span class="content">Native hit test result</span><a class="self-link" href="#native-hit-test-result-section"></a></h3>
   <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="native hit test result|native hit test results" data-noexport id="native-hit-test-result">Native hit test results</dfn> returned from XR device should contain the position of the intersection point with user’s environment. Depending on the native entity type and the information available to the XR device, the result should also contain orientation defined in such a way to allow the user agent to compute a surface normal to the user’s environment at the intersection point.</p>
   <p>The information about position and orientation of the intersection point should be contained in <a data-link-type="dfn" href="#native-hit-test-result" id="ref-for-native-hit-test-result⑤">native hit test result</a>'s native origin. Native origin defines a new coordinate system in such a way that its Y axis represents the surface’s normal vector at the intersection point. If the orientation is not returned from the XR device, the user agent SHOULD set the native origin in such a way that Y axis of the coordinate system it defines is pointing up (towards negative gravity vector).</p>
   <p class="issue" id="issue-4d2e55aa"><a class="self-link" href="#issue-4d2e55aa"></a> Decide if we need to specify other axes of the coordinate system defined by hit test result’s native origin to maintain compatibility between different implementations &amp; differrent AR frameworks.</p>
   <h2 class="heading settled" data-level="10" id="ack"><span class="secno">10. </span><span class="content">Acknowledgements</span><a class="self-link" href="#ack"></a></h2>
   <p>The following individuals have contributed to the design of the WebXR Hit Test specification:</p>
  </main>
  <div data-fill-with="conformance">
   <h2 class="no-ref no-num heading settled" id="conformance"><span class="content"> Conformance</span><a class="self-link" href="#conformance"></a></h2>
   <p> Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology.
            The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL”
            in the normative parts of this document
            are to be interpreted as described in RFC 2119.
            However, for readability,
            these words do not appear in all uppercase letters in this specification. </p>
   <p> All of the text of this specification is normative
            except sections explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a> </p>
   <p> Examples in this specification are introduced with the words “for example”
            or are set apart from the normative text with <code>class="example"</code>, like this: </p>
   <div class="example" id="example-example"><a class="self-link" href="#example-example"></a> This is an example of an informative example. </div>
   <p> Informative notes begin with the word “Note”
            and are set apart from the normative text with <code>class="note"</code>, like this: </p>
   <p class="note" role="note"> Note, this is an informative note. </p>
  </div>
<script>
(function() {
  "use strict";
  var collapseSidebarText = '<span aria-hidden="true">←</span> '
                          + '<span>Collapse Sidebar</span>';
  var expandSidebarText   = '<span aria-hidden="true">→</span> '
                          + '<span>Pop Out Sidebar</span>';
  var tocJumpText         = '<span aria-hidden="true">↑</span> '
                          + '<span>Jump to Table of Contents</span>';

  var sidebarMedia = window.matchMedia('screen and (min-width: 78em)');
  var autoToggle   = function(e){ toggleSidebar(e.matches) };
  if(sidebarMedia.addListener) {
    sidebarMedia.addListener(autoToggle);
  }

  function toggleSidebar(on) {
    if (on == undefined) {
      on = !document.body.classList.contains('toc-sidebar');
    }

    /* Don’t scroll to compensate for the ToC if we’re above it already. */
    var headY = 0;
    var head = document.querySelector('.head');
    if (head) {
      // terrible approx of "top of ToC"
      headY += head.offsetTop + head.offsetHeight;
    }
    var skipScroll = window.scrollY < headY;

    var toggle = document.getElementById('toc-toggle');
    var tocNav = document.getElementById('toc');
    if (on) {
      var tocHeight = tocNav.offsetHeight;
      document.body.classList.add('toc-sidebar');
      document.body.classList.remove('toc-inline');
      toggle.innerHTML = collapseSidebarText;
      if (!skipScroll) {
        window.scrollBy(0, 0 - tocHeight);
      }
      tocNav.focus();
      sidebarMedia.addListener(autoToggle); // auto-collapse when out of room
    }
    else {
      document.body.classList.add('toc-inline');
      document.body.classList.remove('toc-sidebar');
      toggle.innerHTML = expandSidebarText;
      if (!skipScroll) {
        window.scrollBy(0, tocNav.offsetHeight);
      }
      if (toggle.matches(':hover')) {
        /* Unfocus button when not using keyboard navigation,
           because I don’t know where else to send the focus. */
        toggle.blur();
      }
    }
  }

  function createSidebarToggle() {
    /* Create the sidebar toggle in JS; it shouldn’t exist when JS is off. */
    var toggle = document.createElement('a');
      /* This should probably be a button, but appearance isn’t standards-track.*/
    toggle.id = 'toc-toggle';
    toggle.class = 'toc-toggle';
    toggle.href = '#toc';
    toggle.innerHTML = collapseSidebarText;

    sidebarMedia.addListener(autoToggle);
    var toggler = function(e) {
      e.preventDefault();
      sidebarMedia.removeListener(autoToggle); // persist explicit off states
      toggleSidebar();
      return false;
    }
    toggle.addEventListener('click', toggler, false);


    /* Get <nav id=toc-nav>, or make it if we don’t have one. */
    var tocNav = document.getElementById('toc-nav');
    if (!tocNav) {
      tocNav = document.createElement('p');
      tocNav.id = 'toc-nav';
      /* Prepend for better keyboard navigation */
      document.body.insertBefore(tocNav, document.body.firstChild);
    }
    /* While we’re at it, make sure we have a Jump to Toc link. */
    var tocJump = document.getElementById('toc-jump');
    if (!tocJump) {
      tocJump = document.createElement('a');
      tocJump.id = 'toc-jump';
      tocJump.href = '#toc';
      tocJump.innerHTML = tocJumpText;
      tocNav.appendChild(tocJump);
    }

    tocNav.appendChild(toggle);
  }

  var toc = document.getElementById('toc');
  if (toc) {
    createSidebarToggle();
    toggleSidebar(sidebarMedia.matches);

    /* If the sidebar has been manually opened and is currently overlaying the text
       (window too small for the MQ to add the margin to body),
       then auto-close the sidebar once you click on something in there. */
    toc.addEventListener('click', function(e) {
      if(e.target.tagName.toLowerCase() == "a" && document.body.classList.contains('toc-sidebar') && !sidebarMedia.matches) {
        toggleSidebar(false);
      }
    }, false);
  }
  else {
    console.warn("Can’t find Table of Contents. Please use <nav id='toc'> around the ToC.");
  }

  /* Wrap tables in case they overflow */
  var tables = document.querySelectorAll(':not(.overlarge) > table.data, :not(.overlarge) > table.index');
  var numTables = tables.length;
  for (var i = 0; i < numTables; i++) {
    var table = tables[i];
    var wrapper = document.createElement('div');
    wrapper.className = 'overlarge';
    table.parentNode.insertBefore(wrapper, table);
    wrapper.appendChild(table);
  }

})();
</script>
  <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
  <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
  <ul class="index">
   <li>
    active
    <ul>
     <li><a href="#xrhittestsource-active">dfn for XRHitTestSource</a><span>, in §3.1</span>
     <li><a href="#xrtransientinputhittestsource-active">dfn for XRTransientInputHitTestSource</a><span>, in §3.2</span>
    </ul>
   <li>
    cancel()
    <ul>
     <li><a href="#dom-xrhittestsource-cancel">method for XRHitTestSource</a><span>, in §3.1</span>
     <li><a href="#dom-xrtransientinputhittestsource-cancel">method for XRTransientInputHitTestSource</a><span>, in §3.2</span>
    </ul>
   <li><a href="#cancel-a-hit-test-source">cancel a hit test source</a><span>, in §3.1</span>
   <li><a href="#cancel-a-hit-test-source-for-transient-input">cancel a hit test source for transient input</a><span>, in §3.2</span>
   <li><a href="#compute-all-hit-test-results">compute all hit test results</a><span>, in §6</span>
   <li><a href="#compute-hit-test-results">compute hit test results</a><span>, in §6</span>
   <li><a href="#compute-hit-test-results-for-transient-input">compute hit test results for transient input</a><span>, in §6</span>
   <li><a href="#convert-from-native-entity-type">convert from native entity type</a><span>, in §9.2</span>
   <li><a href="#create-a-hit-test-result">create a hit test result</a><span>, in §4.1</span>
   <li><a href="#create-a-hit-test-result-for-transient-input">create a hit test result for transient input</a><span>, in §4.2</span>
   <li><a href="#create-a-hit-test-source">create a hit test source</a><span>, in §3.1</span>
   <li><a href="#create-a-hit-test-source-for-transient-input">create a hit test source for transient input</a><span>, in §3.2</span>
   <li><a href="#dom-xrray-direction">direction</a><span>, in §8.1</span>
   <li><a href="#distance-along-the-ray">distance along the ray</a><span>, in §8.1</span>
   <li>
    effective entityTypes
    <ul>
     <li><a href="#xrhittestoptionsinit-effective-entitytypes">dfn for XRHitTestOptionsInit</a><span>, in §2.2</span>
     <li><a href="#xrtransientinputhittestoptionsinit-effective-entitytypes">dfn for XRTransientInputHitTestOptionsInit</a><span>, in §2.3</span>
    </ul>
   <li>
    effective offsetRay
    <ul>
     <li><a href="#xrhittestoptionsinit-effective-offsetray">dfn for XRHitTestOptionsInit</a><span>, in §2.2</span>
     <li><a href="#xrtransientinputhittestoptionsinit-effective-offsetray">dfn for XRTransientInputHitTestOptionsInit</a><span>, in §2.3</span>
    </ul>
   <li>
    entity types
    <ul>
     <li><a href="#xrhittestsource-entity-types">dfn for XRHitTestSource</a><span>, in §3.1</span>
     <li><a href="#xrtransientinputhittestsource-entity-types">dfn for XRTransientInputHitTestSource</a><span>, in §3.2</span>
    </ul>
   <li>
    entityTypes
    <ul>
     <li><a href="#dom-xrhittestoptionsinit-entitytypes">dict-member for XRHitTestOptionsInit</a><span>, in §2.2</span>
     <li><a href="#dom-xrtransientinputhittestoptionsinit-entitytypes">dict-member for XRTransientInputHitTestOptionsInit</a><span>, in §2.3</span>
    </ul>
   <li>
    frame
    <ul>
     <li><a href="#xrhittestresult-frame">dfn for XRHitTestResult</a><span>, in §4.1</span>
     <li><a href="#xrtransientinputhittestresult-frame">dfn for XRTransientInputHitTestResult</a><span>, in §4.2</span>
    </ul>
   <li><a href="#dom-xrframe-gethittestresultsfortransientinput">getHitTestResultsForTransientInput(hitTestSource)</a><span>, in §7</span>
   <li><a href="#dom-xrframe-gethittestresults">getHitTestResults(hitTestSource)</a><span>, in §7</span>
   <li><a href="#dom-xrhittestresult-getpose">getPose(baseSpace)</a><span>, in §4.1</span>
   <li><a href="#dom-xrtransientinputhittestresult-inputsource">inputSource</a><span>, in §4.2</span>
   <li><a href="#xrframe-map-of-hit-test-sources-to-hit-test-results">map of hit test sources to hit test results</a><span>, in §7</span>
   <li><a href="#xrframe-map-of-hit-test-sources-to-hit-test-results-for-transient-input">map of hit test sources to hit test results for transient input</a><span>, in §7</span>
   <li>
    matrix
    <ul>
     <li><a href="#dom-xrray-matrix">attribute for XRRay</a><span>, in §8.1</span>
     <li><a href="#xrray-matrix">dfn for XRRay</a><span>, in §8.1</span>
    </ul>
   <li><a href="#dom-xrhittesttrackabletype-mesh">"mesh"</a><span>, in §2.1</span>
   <li><a href="#native-entity-type">native entity type</a><span>, in §9.2</span>
   <li><a href="#native-hit-test">native hit test</a><span>, in §9.1</span>
   <li><a href="#native-hit-test-result">native hit test result</a><span>, in §9.3</span>
   <li><a href="#native-hit-test-result">native hit test results</a><span>, in §9.3</span>
   <li>
    native origin
    <ul>
     <li><a href="#xrhittestresult-native-origin">dfn for XRHitTestResult</a><span>, in §4.1</span>
     <li><a href="#xrhittestsource-native-origin">dfn for XRHitTestSource</a><span>, in §3.1</span>
    </ul>
   <li><a href="#obtain-hit-test-results">obtain hit test results</a><span>, in §7</span>
   <li><a href="#obtain-hit-test-results-for-transient-input">obtain hit test results for transient input</a><span>, in §7</span>
   <li><a href="#xrray-obtain-the-matrix">obtain the matrix</a><span>, in §8.1</span>
   <li>
    offset ray
    <ul>
     <li><a href="#xrhittestsource-offset-ray">dfn for XRHitTestSource</a><span>, in §3.1</span>
     <li><a href="#xrtransientinputhittestsource-offset-ray">dfn for XRTransientInputHitTestSource</a><span>, in §3.2</span>
    </ul>
   <li>
    offsetRay
    <ul>
     <li><a href="#dom-xrhittestoptionsinit-offsetray">dict-member for XRHitTestOptionsInit</a><span>, in §2.2</span>
     <li><a href="#dom-xrtransientinputhittestoptionsinit-offsetray">dict-member for XRTransientInputHitTestOptionsInit</a><span>, in §2.3</span>
    </ul>
   <li><a href="#dom-xrray-origin">origin</a><span>, in §8.1</span>
   <li><a href="#dom-xrhittesttrackabletype-plane">"plane"</a><span>, in §2.1</span>
   <li><a href="#dom-xrhittesttrackabletype-point">"point"</a><span>, in §2.1</span>
   <li>
    profile
    <ul>
     <li><a href="#xrtransientinputhittestsource-profile">dfn for XRTransientInputHitTestSource</a><span>, in §3.2</span>
     <li><a href="#dom-xrtransientinputhittestoptionsinit-profile">dict-member for XRTransientInputHitTestOptionsInit</a><span>, in §2.3</span>
    </ul>
   <li><a href="#request-hit-test">request hit test</a><span>, in §5</span>
   <li><a href="#dom-xrsession-requesthittestsourcefortransientinput">requestHitTestSourceForTransientInput(options)</a><span>, in §5</span>
   <li><a href="#dom-xrsession-requesthittestsource">requestHitTestSource(options)</a><span>, in §5</span>
   <li><a href="#dom-xrtransientinputhittestresult-results">results</a><span>, in §4.2</span>
   <li>
    session
    <ul>
     <li><a href="#xrhittestsource-session">dfn for XRHitTestSource</a><span>, in §3.1</span>
     <li><a href="#xrtransientinputhittestsource-session">dfn for XRTransientInputHitTestSource</a><span>, in §3.2</span>
    </ul>
   <li><a href="#xrsession-set-of-active-hit-test-sources">set of active hit test sources</a><span>, in §5</span>
   <li><a href="#xrsession-set-of-active-hit-test-sources-for-transient-input">set of active hit test sources for transient input</a><span>, in §5</span>
   <li><a href="#dom-xrhittestoptionsinit-space">space</a><span>, in §2.2</span>
   <li><a href="#dictdef-xrhittestoptionsinit">XRHitTestOptionsInit</a><span>, in §2.2</span>
   <li><a href="#xrhittestresult">XRHitTestResult</a><span>, in §4.1</span>
   <li><a href="#xrhittestsource">XRHitTestSource</a><span>, in §3.1</span>
   <li><a href="#enumdef-xrhittesttrackabletype">XRHitTestTrackableType</a><span>, in §2.1</span>
   <li><a href="#xrray">XRRay</a><span>, in §8.1</span>
   <li><a href="#dom-xrray-xrray">XRRay()</a><span>, in §8.1</span>
   <li><a href="#dom-xrray-xrray">XRRay(origin)</a><span>, in §8.1</span>
   <li><a href="#dom-xrray-xrray">XRRay(origin, direction)</a><span>, in §8.1</span>
   <li><a href="#dom-xrray-xrray-transform">XRRay(transform)</a><span>, in §8.1</span>
   <li><a href="#dictdef-xrtransientinputhittestoptionsinit">XRTransientInputHitTestOptionsInit</a><span>, in §2.3</span>
   <li><a href="#xrtransientinputhittestresult">XRTransientInputHitTestResult</a><span>, in §4.2</span>
   <li><a href="#xrtransientinputhittestsource">XRTransientInputHitTestSource</a><span>, in §3.2</span>
  </ul>
  <aside class="dfn-panel" data-for="term-for-sec-isdetachedbuffer">
   <a href="https://tc39.github.io/ecma262/#sec-isdetachedbuffer">https://tc39.github.io/ecma262/#sec-isdetachedbuffer</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-isdetachedbuffer">8.1. XRRay</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dictdef-dompointinit">
   <a href="https://drafts.fxtf.org/geometry-1/#dictdef-dompointinit">https://drafts.fxtf.org/geometry-1/#dictdef-dompointinit</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-dompointinit">8.1. XRRay</a> <a href="#ref-for-dictdef-dompointinit①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dompointreadonly">
   <a href="https://drafts.fxtf.org/geometry-1/#dompointreadonly">https://drafts.fxtf.org/geometry-1/#dompointreadonly</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dompointreadonly">8.1. XRRay</a> <a href="#ref-for-dompointreadonly①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-dompointreadonly-w">
   <a href="https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-w">https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-w</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-dompointreadonly-w">8.1. XRRay</a> <a href="#ref-for-dom-dompointreadonly-w①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-dompointreadonly-x">
   <a href="https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-x">https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-x</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-dompointreadonly-x">8.1. XRRay</a> <a href="#ref-for-dom-dompointreadonly-x①">(2)</a> <a href="#ref-for-dom-dompointreadonly-x②">(3)</a> <a href="#ref-for-dom-dompointreadonly-x③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-dompointreadonly-y">
   <a href="https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-y">https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-y</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-dompointreadonly-y">8.1. XRRay</a> <a href="#ref-for-dom-dompointreadonly-y①">(2)</a> <a href="#ref-for-dom-dompointreadonly-y②">(3)</a> <a href="#ref-for-dom-dompointreadonly-y③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-dompointreadonly-z">
   <a href="https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-z">https://drafts.fxtf.org/geometry-1/#dom-dompointreadonly-z</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-dompointreadonly-z">8.1. XRRay</a> <a href="#ref-for-dom-dompointreadonly-z①">(2)</a> <a href="#ref-for-dom-dompointreadonly-z②">(3)</a> <a href="#ref-for-dom-dompointreadonly-z③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list">
   <a href="https://infra.spec.whatwg.org/#list">https://infra.spec.whatwg.org/#list</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list">6. Computing hit test results</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-a-new-promise">
   <a href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise">https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-a-new-promise">5. Requesting hit test</a> <a href="#ref-for-a-new-promise①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-reject-promise">
   <a href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise">https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-reject-promise">5. Requesting hit test</a> <a href="#ref-for-reject-promise①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-resolve-promise">
   <a href="https://www.w3.org/2001/tag/doc/promises-guide/#resolve-promise">https://www.w3.org/2001/tag/doc/promises-guide/#resolve-promise</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-resolve-promise">5. Requesting hit test</a> <a href="#ref-for-resolve-promise①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-DOMString">
   <a href="https://heycam.github.io/webidl/#idl-DOMString">https://heycam.github.io/webidl/#idl-DOMString</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-DOMString">2.3. XRTransientInputHitTestOptionsInit</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-Exposed">
   <a href="https://heycam.github.io/webidl/#Exposed">https://heycam.github.io/webidl/#Exposed</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-Exposed">3.1. XRHitTestSource</a>
    <li><a href="#ref-for-Exposed①">3.2. XRTransientInputHitTestSource</a>
    <li><a href="#ref-for-Exposed②">4.1. XRHitTestResult</a>
    <li><a href="#ref-for-Exposed③">4.2. XRTransientInputHitTestResult</a>
    <li><a href="#ref-for-Exposed④">8.1. XRRay</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-Float32Array">
   <a href="https://heycam.github.io/webidl/#idl-Float32Array">https://heycam.github.io/webidl/#idl-Float32Array</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-Float32Array">8.1. XRRay</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-invalidstateerror">
   <a href="https://heycam.github.io/webidl/#invalidstateerror">https://heycam.github.io/webidl/#invalidstateerror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-invalidstateerror">3.1. XRHitTestSource</a>
    <li><a href="#ref-for-invalidstateerror①">3.2. XRTransientInputHitTestSource</a>
    <li><a href="#ref-for-invalidstateerror②">4.1. XRHitTestResult</a>
    <li><a href="#ref-for-invalidstateerror③">7. Obtaining hit test results</a> <a href="#ref-for-invalidstateerror④">(2)</a> <a href="#ref-for-invalidstateerror⑤">(3)</a> <a href="#ref-for-invalidstateerror⑥">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-operationerror">
   <a href="https://heycam.github.io/webidl/#operationerror">https://heycam.github.io/webidl/#operationerror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-operationerror">5. Requesting hit test</a> <a href="#ref-for-operationerror①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-SameObject">
   <a href="https://heycam.github.io/webidl/#SameObject">https://heycam.github.io/webidl/#SameObject</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-SameObject">4.2. XRTransientInputHitTestResult</a>
    <li><a href="#ref-for-SameObject①">8.1. XRRay</a> <a href="#ref-for-SameObject②">(2)</a> <a href="#ref-for-SameObject③">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-SecureContext">
   <a href="https://heycam.github.io/webidl/#SecureContext">https://heycam.github.io/webidl/#SecureContext</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-SecureContext">3.1. XRHitTestSource</a>
    <li><a href="#ref-for-SecureContext①">3.2. XRTransientInputHitTestSource</a>
    <li><a href="#ref-for-SecureContext②">4.1. XRHitTestResult</a>
    <li><a href="#ref-for-SecureContext③">4.2. XRTransientInputHitTestResult</a>
    <li><a href="#ref-for-SecureContext④">8.1. XRRay</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-xrframe-interface">
   <a href="https://www.w3.org/TR/webxr/#xrframe-interface">https://www.w3.org/TR/webxr/#xrframe-interface</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrframe-interface">4.1. XRHitTestResult</a> <a href="#ref-for-xrframe-interface①">(2)</a>
    <li><a href="#ref-for-xrframe-interface②">4.2. XRTransientInputHitTestResult</a> <a href="#ref-for-xrframe-interface③">(2)</a>
    <li><a href="#ref-for-xrframe-interface④">6. Computing hit test results</a> <a href="#ref-for-xrframe-interface⑤">(2)</a> <a href="#ref-for-xrframe-interface⑥">(3)</a>
    <li><a href="#ref-for-xrframe-interface⑦">7. Obtaining hit test results</a> <a href="#ref-for-xrframe-interface⑧">(2)</a> <a href="#ref-for-xrframe-interface⑨">(3)</a> <a href="#ref-for-xrframe-interface①⓪">(4)</a> <a href="#ref-for-xrframe-interface①①">(5)</a> <a href="#ref-for-xrframe-interface①②">(6)</a> <a href="#ref-for-xrframe-interface①③">(7)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-xrrigidtransform-interface">
   <a href="https://www.w3.org/TR/webxr/#xrrigidtransform-interface">https://www.w3.org/TR/webxr/#xrrigidtransform-interface</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrrigidtransform-interface">8.1. XRRay</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-xrsession-interface">
   <a href="https://www.w3.org/TR/webxr/#xrsession-interface">https://www.w3.org/TR/webxr/#xrsession-interface</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrsession-interface">3.1. XRHitTestSource</a>
    <li><a href="#ref-for-xrsession-interface①">3.2. XRTransientInputHitTestSource</a>
    <li><a href="#ref-for-xrsession-interface②">5. Requesting hit test</a> <a href="#ref-for-xrsession-interface③">(2)</a> <a href="#ref-for-xrsession-interface④">(3)</a> <a href="#ref-for-xrsession-interface⑤">(4)</a> <a href="#ref-for-xrsession-interface⑥">(5)</a> <a href="#ref-for-xrsession-interface⑦">(6)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-xrframe-active">
   <a href="https://www.w3.org/TR/webxr/#xrframe-active">https://www.w3.org/TR/webxr/#xrframe-active</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrframe-active">4.1. XRHitTestResult</a>
    <li><a href="#ref-for-xrframe-active①">7. Obtaining hit test results</a> <a href="#ref-for-xrframe-active②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-xrspace-effective-origin">
   <a href="https://www.w3.org/TR/webxr/#xrspace-effective-origin">https://www.w3.org/TR/webxr/#xrspace-effective-origin</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrspace-effective-origin">3.1. XRHitTestSource</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-identity-transform">
   <a href="https://www.w3.org/TR/webxr/#identity-transform">https://www.w3.org/TR/webxr/#identity-transform</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-identity-transform">4.1. XRHitTestResult</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-xrinputsource-input-profile-name">
   <a href="https://www.w3.org/TR/webxr/#xrinputsource-input-profile-name">https://www.w3.org/TR/webxr/#xrinputsource-input-profile-name</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrinputsource-input-profile-name">2.3. XRTransientInputHitTestOptionsInit</a>
    <li><a href="#ref-for-xrinputsource-input-profile-name①">3.2. XRTransientInputHitTestSource</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list-of-active-xr-input-sources">
   <a href="https://www.w3.org/TR/webxr/#list-of-active-xr-input-sources">https://www.w3.org/TR/webxr/#list-of-active-xr-input-sources</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list-of-active-xr-input-sources">6. Computing hit test results</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-xrsession-list-of-frame-updates">
   <a href="https://www.w3.org/TR/webxr/#xrsession-list-of-frame-updates">https://www.w3.org/TR/webxr/#xrsession-list-of-frame-updates</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrsession-list-of-frame-updates">5. Requesting hit test</a> <a href="#ref-for-xrsession-list-of-frame-updates①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-xrrigidtransform-matrix">
   <a href="https://www.w3.org/TR/webxr/#dom-xrrigidtransform-matrix">https://www.w3.org/TR/webxr/#dom-xrrigidtransform-matrix</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrrigidtransform-matrix">8.1. XRRay</a> <a href="#ref-for-dom-xrrigidtransform-matrix①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-xrspace-native-origin">
   <a href="https://www.w3.org/TR/webxr/#xrspace-native-origin">https://www.w3.org/TR/webxr/#xrspace-native-origin</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrspace-native-origin">3.1. XRHitTestSource</a> <a href="#ref-for-xrspace-native-origin①">(2)</a> <a href="#ref-for-xrspace-native-origin②">(3)</a>
    <li><a href="#ref-for-xrspace-native-origin③">4.1. XRHitTestResult</a>
    <li><a href="#ref-for-xrspace-native-origin④">6. Computing hit test results</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-normalize">
   <a href="https://www.w3.org/TR/webxr/#normalize">https://www.w3.org/TR/webxr/#normalize</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-normalize">8.1. XRRay</a> <a href="#ref-for-normalize①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-xrspace-origin-offset">
   <a href="https://www.w3.org/TR/webxr/#xrspace-origin-offset">https://www.w3.org/TR/webxr/#xrspace-origin-offset</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrspace-origin-offset">4.1. XRHitTestResult</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-populate-the-pose">
   <a href="https://www.w3.org/TR/webxr/#populate-the-pose">https://www.w3.org/TR/webxr/#populate-the-pose</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-populate-the-pose">4.1. XRHitTestResult</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-xrspace-session">
   <a href="https://www.w3.org/TR/webxr/#xrspace-session">https://www.w3.org/TR/webxr/#xrspace-session</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrspace-session">4.1. XRHitTestResult</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-xrsession-xr-device">
   <a href="https://www.w3.org/TR/webxr/#xrsession-xr-device">https://www.w3.org/TR/webxr/#xrsession-xr-device</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrsession-xr-device">4.1. XRHitTestResult</a>
    <li><a href="#ref-for-xrsession-xr-device①">6. Computing hit test results</a> <a href="#ref-for-xrsession-xr-device②">(2)</a>
   </ul>
  </aside>
  <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
  <ul class="index">
   <li>
    <a data-link-type="biblio">[ECMASCRIPT]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-sec-isdetachedbuffer" style="color:initial">IsDetachedBuffer</span>
    </ul>
   <li>
    <a data-link-type="biblio">[geometry-1]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-dictdef-dompointinit" style="color:initial">DOMPointInit</span>
     <li><span class="dfn-paneled" id="term-for-dompointreadonly" style="color:initial">DOMPointReadOnly</span>
     <li><span class="dfn-paneled" id="term-for-dom-dompointreadonly-w" style="color:initial">w</span>
     <li><span class="dfn-paneled" id="term-for-dom-dompointreadonly-x" style="color:initial">x</span>
     <li><span class="dfn-paneled" id="term-for-dom-dompointreadonly-y" style="color:initial">y</span>
     <li><span class="dfn-paneled" id="term-for-dom-dompointreadonly-z" style="color:initial">z</span>
    </ul>
   <li>
    <a data-link-type="biblio">[INFRA]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-list" style="color:initial">list</span>
    </ul>
   <li>
    <a data-link-type="biblio">[promises-guide]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-a-new-promise" style="color:initial">a new promise</span>
     <li><span class="dfn-paneled" id="term-for-reject-promise" style="color:initial">reject</span>
     <li><span class="dfn-paneled" id="term-for-resolve-promise" style="color:initial">resolve</span>
    </ul>
   <li>
    <a data-link-type="biblio">[WebIDL]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-idl-DOMString" style="color:initial">DOMString</span>
     <li><span class="dfn-paneled" id="term-for-Exposed" style="color:initial">Exposed</span>
     <li><span class="dfn-paneled" id="term-for-idl-Float32Array" style="color:initial">Float32Array</span>
     <li><span class="dfn-paneled" id="term-for-invalidstateerror" style="color:initial">InvalidStateError</span>
     <li><span class="dfn-paneled" id="term-for-operationerror" style="color:initial">OperationError</span>
     <li><span class="dfn-paneled" id="term-for-SameObject" style="color:initial">SameObject</span>
     <li><span class="dfn-paneled" id="term-for-SecureContext" style="color:initial">SecureContext</span>
    </ul>
   <li>
    <a data-link-type="biblio">[webxr device api - level 1]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-xrframe-interface" style="color:initial">XRFrame</span>
     <li><span class="dfn-paneled" id="term-for-xrrigidtransform-interface" style="color:initial">XRRigidTransform</span>
     <li><span class="dfn-paneled" id="term-for-xrsession-interface" style="color:initial">XRSession</span>
     <li><span class="dfn-paneled" id="term-for-xrframe-active" style="color:initial">active</span>
     <li><span class="dfn-paneled" id="term-for-xrspace-effective-origin" style="color:initial">effective origin</span>
     <li><span class="dfn-paneled" id="term-for-identity-transform" style="color:initial">identity transform</span>
     <li><span class="dfn-paneled" id="term-for-xrinputsource-input-profile-name" style="color:initial">input profile name</span>
     <li><span class="dfn-paneled" id="term-for-list-of-active-xr-input-sources" style="color:initial">list of active xr input sources</span>
     <li><span class="dfn-paneled" id="term-for-xrsession-list-of-frame-updates" style="color:initial">list of frame updates</span>
     <li><span class="dfn-paneled" id="term-for-dom-xrrigidtransform-matrix" style="color:initial">matrix <small>(for XRRigidTransform)</small></span>
     <li><span class="dfn-paneled" id="term-for-xrspace-native-origin" style="color:initial">native origin</span>
     <li><span class="dfn-paneled" id="term-for-normalize" style="color:initial">normalize</span>
     <li><span class="dfn-paneled" id="term-for-xrspace-origin-offset" style="color:initial">origin offset</span>
     <li><span class="dfn-paneled" id="term-for-populate-the-pose" style="color:initial">populate the pose</span>
     <li><span class="dfn-paneled" id="term-for-xrspace-session" style="color:initial">session <small>(for XRSpace)</small></span>
     <li><span class="dfn-paneled" id="term-for-xrsession-xr-device" style="color:initial">xr device <small>(for XRSession)</small></span>
    </ul>
  </ul>
  <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
  <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
  <dl>
   <dt id="biblio-ecmascript">[ECMASCRIPT]
   <dd><a href="https://tc39.github.io/ecma262/">ECMAScript Language Specification</a>. URL: <a href="https://tc39.github.io/ecma262/">https://tc39.github.io/ecma262/</a>
   <dt id="biblio-geometry-1">[GEOMETRY-1]
   <dd>Simon Pieters; Chris Harrelson. <a href="https://www.w3.org/TR/geometry-1/">Geometry Interfaces Module Level 1</a>. 4 December 2018. CR. URL: <a href="https://www.w3.org/TR/geometry-1/">https://www.w3.org/TR/geometry-1/</a>
   <dt id="biblio-infra">[INFRA]
   <dd>Anne van Kesteren; Domenic Denicola. <a href="https://infra.spec.whatwg.org/">Infra Standard</a>. Living Standard. URL: <a href="https://infra.spec.whatwg.org/">https://infra.spec.whatwg.org/</a>
   <dt id="biblio-promises-guide">[PROMISES-GUIDE]
   <dd>Domenic Denicola. <a href="https://www.w3.org/2001/tag/doc/promises-guide">Writing Promise-Using Specifications</a>. 9 November 2018. TAG Finding. URL: <a href="https://www.w3.org/2001/tag/doc/promises-guide">https://www.w3.org/2001/tag/doc/promises-guide</a>
   <dt id="biblio-rfc2119">[RFC2119]
   <dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
   <dt id="biblio-webidl">[WebIDL]
   <dd>Boris Zbarsky. <a href="https://heycam.github.io/webidl/">Web IDL</a>. 15 December 2016. ED. URL: <a href="https://heycam.github.io/webidl/">https://heycam.github.io/webidl/</a>
  </dl>
  <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">IDL Index</span><a class="self-link" href="#idl-index"></a></h2>
<pre class="idl highlight def"><c- b>enum</c-> <a href="#enumdef-xrhittesttrackabletype"><code><c- g>XRHitTestTrackableType</c-></code></a> {
  <a class="idl-code" data-link-type="enum-value" href="#dom-xrhittesttrackabletype-point" id="ref-for-dom-xrhittesttrackabletype-point③"><c- s>"point"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-xrhittesttrackabletype-plane" id="ref-for-dom-xrhittesttrackabletype-plane⑤"><c- s>"plane"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-xrhittesttrackabletype-mesh" id="ref-for-dom-xrhittesttrackabletype-mesh③"><c- s>"mesh"</c-></a>
};

<c- b>dictionary</c-> <a href="#dictdef-xrhittestoptionsinit"><code><c- g>XRHitTestOptionsInit</c-></code></a> {
  <c- b>required</c-> <a class="n" data-link-type="idl-name"><c- n>XRSpace</c-></a> <a class="idl-code" data-link-type="dict-member" data-type="XRSpace " href="#dom-xrhittestoptionsinit-space" id="ref-for-dom-xrhittestoptionsinit-space③"><c- g>space</c-></a>;
  <c- b>FrozenArray</c->&lt;<a class="n" data-link-type="idl-name" href="#enumdef-xrhittesttrackabletype" id="ref-for-enumdef-xrhittesttrackabletype①①"><c- n>XRHitTestTrackableType</c-></a>> <a class="idl-code" data-link-type="dict-member" data-type="FrozenArray<XRHitTestTrackableType> " href="#dom-xrhittestoptionsinit-entitytypes" id="ref-for-dom-xrhittestoptionsinit-entitytypes③"><c- g>entityTypes</c-></a>;
  <a class="n" data-link-type="idl-name" href="#xrray" id="ref-for-xrray①⑧"><c- n>XRRay</c-></a> <a class="idl-code" data-link-type="dict-member" data-type="XRRay " href="#dom-xrhittestoptionsinit-offsetray" id="ref-for-dom-xrhittestoptionsinit-offsetray⑤"><c- g>offsetRay</c-></a>;
};

<c- b>dictionary</c-> <a href="#dictdef-xrtransientinputhittestoptionsinit"><code><c- g>XRTransientInputHitTestOptionsInit</c-></code></a> {
  <c- b>required</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="dict-member" data-type="DOMString " href="#dom-xrtransientinputhittestoptionsinit-profile" id="ref-for-dom-xrtransientinputhittestoptionsinit-profile③"><c- g>profile</c-></a>;
  <c- b>FrozenArray</c->&lt;<a class="n" data-link-type="idl-name" href="#enumdef-xrhittesttrackabletype" id="ref-for-enumdef-xrhittesttrackabletype③①"><c- n>XRHitTestTrackableType</c-></a>> <a class="idl-code" data-link-type="dict-member" data-type="FrozenArray<XRHitTestTrackableType> " href="#dom-xrtransientinputhittestoptionsinit-entitytypes" id="ref-for-dom-xrtransientinputhittestoptionsinit-entitytypes③"><c- g>entityTypes</c-></a>;
  <a class="n" data-link-type="idl-name" href="#xrray" id="ref-for-xrray③①"><c- n>XRRay</c-></a> <a class="idl-code" data-link-type="dict-member" data-type="XRRay " href="#dom-xrtransientinputhittestoptionsinit-offsetray" id="ref-for-dom-xrtransientinputhittestoptionsinit-offsetray④"><c- g>offsetRay</c-></a>;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext⑤"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑤"><c- g>Exposed</c-></a>=<c- n>Window</c->]
<c- b>interface</c-> <a href="#xrhittestsource"><code><c- g>XRHitTestSource</c-></code></a> {
  <c- b>void</c-> <a class="idl-code" data-link-type="method" href="#dom-xrhittestsource-cancel" id="ref-for-dom-xrhittestsource-cancel②"><c- g>cancel</c-></a>();
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①①"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①①"><c- g>Exposed</c-></a>=<c- n>Window</c->]
<c- b>interface</c-> <a href="#xrtransientinputhittestsource"><code><c- g>XRTransientInputHitTestSource</c-></code></a> {
  <c- b>void</c-> <a class="idl-code" data-link-type="method" href="#dom-xrtransientinputhittestsource-cancel" id="ref-for-dom-xrtransientinputhittestsource-cancel②"><c- g>cancel</c-></a>();
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext②①"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed②①"><c- g>Exposed</c-></a>=<c- n>Window</c->]
<c- b>interface</c-> <a href="#xrhittestresult"><code><c- g>XRHitTestResult</c-></code></a> {
  <a class="n" data-link-type="idl-name"><c- n>XRPose</c-></a>? <a class="idl-code" data-link-type="method" href="#dom-xrhittestresult-getpose" id="ref-for-dom-xrhittestresult-getpose②"><c- g>getPose</c-></a>(<a class="n" data-link-type="idl-name"><c- n>XRSpace</c-></a> <a href="#dom-xrhittestresult-getpose-basespace-basespace"><code><c- g>baseSpace</c-></code></a>);
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext③①"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed③①"><c- g>Exposed</c-></a>=<c- n>Window</c->]
<c- b>interface</c-> <a href="#xrtransientinputhittestresult"><code><c- g>XRTransientInputHitTestResult</c-></code></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject④"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name"><c- n>XRInputSource</c-></a> <a data-readonly data-type="XRInputSource" href="#dom-xrtransientinputhittestresult-inputsource"><code><c- g>inputSource</c-></code></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <c- b>FrozenArray</c->&lt;<a class="n" data-link-type="idl-name" href="#xrhittestresult" id="ref-for-xrhittestresult⑤①"><c- n>XRHitTestResult</c-></a>> <a data-readonly data-type="FrozenArray<XRHitTestResult>" href="#dom-xrtransientinputhittestresult-results"><code><c- g>results</c-></code></a>;
};

<c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://www.w3.org/TR/webxr/#xrsession-interface" id="ref-for-xrsession-interface②①"><c- g>XRSession</c-></a> {
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#xrhittestsource" id="ref-for-xrhittestsource⑨①"><c- n>XRHitTestSource</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-xrsession-requesthittestsource" id="ref-for-dom-xrsession-requesthittestsource②"><c- g>requestHitTestSource</c-></a>(<a class="n" data-link-type="idl-name" href="#dictdef-xrhittestoptionsinit" id="ref-for-dictdef-xrhittestoptionsinit③①"><c- n>XRHitTestOptionsInit</c-></a> <a href="#dom-xrsession-requesthittestsource-options-options"><code><c- g>options</c-></code></a>);
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#xrtransientinputhittestsource" id="ref-for-xrtransientinputhittestsource⑨①"><c- n>XRTransientInputHitTestSource</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-xrsession-requesthittestsourcefortransientinput" id="ref-for-dom-xrsession-requesthittestsourcefortransientinput①"><c- g>requestHitTestSourceForTransientInput</c-></a>(<a class="n" data-link-type="idl-name" href="#dictdef-xrtransientinputhittestoptionsinit" id="ref-for-dictdef-xrtransientinputhittestoptionsinit③①"><c- n>XRTransientInputHitTestOptionsInit</c-></a> <a href="#dom-xrsession-requesthittestsourcefortransientinput-options-options"><code><c- g>options</c-></code></a>);
};

<c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://www.w3.org/TR/webxr/#xrframe-interface" id="ref-for-xrframe-interface⑦①"><c- g>XRFrame</c-></a> {
  <c- b>FrozenArray</c->&lt;<a class="n" data-link-type="idl-name" href="#xrhittestresult" id="ref-for-xrhittestresult⑧①"><c- n>XRHitTestResult</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-xrframe-gethittestresults" id="ref-for-dom-xrframe-gethittestresults②"><c- g>getHitTestResults</c-></a>(<a class="n" data-link-type="idl-name" href="#xrhittestsource" id="ref-for-xrhittestsource①⓪①"><c- n>XRHitTestSource</c-></a> <a href="#dom-xrframe-gethittestresults-hittestsource-hittestsource"><code><c- g>hitTestSource</c-></code></a>);
  <c- b>FrozenArray</c->&lt;<a class="n" data-link-type="idl-name" href="#xrtransientinputhittestresult" id="ref-for-xrtransientinputhittestresult③①"><c- n>XRTransientInputHitTestResult</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-xrframe-gethittestresultsfortransientinput" id="ref-for-dom-xrframe-gethittestresultsfortransientinput②"><c- g>getHitTestResultsForTransientInput</c-></a>(<a class="n" data-link-type="idl-name" href="#xrtransientinputhittestsource" id="ref-for-xrtransientinputhittestsource①⓪①"><c- n>XRTransientInputHitTestSource</c-></a> <a href="#dom-xrframe-gethittestresultsfortransientinput-hittestsource-hittestsource"><code><c- g>hitTestSource</c-></code></a>);
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext④①"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed④①"><c- g>Exposed</c-></a>=<c- n>Window</c->,
 <a class="idl-code" data-link-type="constructor" href="#dom-xrray-xrray" id="ref-for-dom-xrray-xrray②①"><c- g>Constructor</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="https://drafts.fxtf.org/geometry-1/#dictdef-dompointinit" id="ref-for-dictdef-dompointinit②"><c- n>DOMPointInit</c-></a> <a href="#dom-xrray-xrray-origin-direction-origin"><code><c- g>origin</c-></code></a>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="https://drafts.fxtf.org/geometry-1/#dictdef-dompointinit" id="ref-for-dictdef-dompointinit①①"><c- n>DOMPointInit</c-></a> <a href="#dom-xrray-xrray-origin-direction-direction"><code><c- g>direction</c-></code></a>),
 <a class="idl-code" data-link-type="constructor" href="#dom-xrray-xrray-transform" id="ref-for-dom-xrray-xrray-transform①"><c- g>Constructor</c-></a>(<a class="n" data-link-type="idl-name" href="https://www.w3.org/TR/webxr/#xrrigidtransform-interface" id="ref-for-xrrigidtransform-interface①"><c- n>XRRigidTransform</c-></a> <a href="#dom-xrray-xrray-transform-transform"><code><c- g>transform</c-></code></a>)]
<c- b>interface</c-> <a href="#xrray"><code><c- g>XRRay</c-></code></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject①①"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://drafts.fxtf.org/geometry-1/#dompointreadonly" id="ref-for-dompointreadonly②"><c- n>DOMPointReadOnly</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMPointReadOnly" href="#dom-xrray-origin" id="ref-for-dom-xrray-origin①①"><c- g>origin</c-></a>;
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject②①"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://drafts.fxtf.org/geometry-1/#dompointreadonly" id="ref-for-dompointreadonly①①"><c- n>DOMPointReadOnly</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMPointReadOnly" href="#dom-xrray-direction" id="ref-for-dom-xrray-direction①③"><c- g>direction</c-></a>;
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject③①"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-Float32Array" id="ref-for-idl-Float32Array①"><c- b>Float32Array</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="Float32Array" href="#dom-xrray-matrix" id="ref-for-dom-xrray-matrix②"><c- g>matrix</c-></a>;
};

</pre>
  <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content">Issues Index</span><a class="self-link" href="#issues-index"></a></h2>
  <div style="counter-reset:issue">
   <div class="issue"> Decide if we need to specify other axes of the coordinate system defined by hit test result’s native origin to maintain compatibility between different implementations &amp; differrent AR frameworks.<a href="#issue-4d2e55aa"> ↵ </a></div>
  </div>
  <aside class="dfn-panel" data-for="enumdef-xrhittesttrackabletype">
   <b><a href="#enumdef-xrhittesttrackabletype">#enumdef-xrhittesttrackabletype</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-enumdef-xrhittesttrackabletype">2.1. XRHitTestTrackableType</a>
    <li><a href="#ref-for-enumdef-xrhittesttrackabletype①">2.2. XRHitTestOptionsInit</a> <a href="#ref-for-enumdef-xrhittesttrackabletype②">(2)</a>
    <li><a href="#ref-for-enumdef-xrhittesttrackabletype③">2.3. XRTransientInputHitTestOptionsInit</a> <a href="#ref-for-enumdef-xrhittesttrackabletype④">(2)</a>
    <li><a href="#ref-for-enumdef-xrhittesttrackabletype⑤">3.1. XRHitTestSource</a>
    <li><a href="#ref-for-enumdef-xrhittesttrackabletype⑥">3.2. XRTransientInputHitTestSource</a>
    <li><a href="#ref-for-enumdef-xrhittesttrackabletype⑦">4.1. XRHitTestResult</a>
    <li><a href="#ref-for-enumdef-xrhittesttrackabletype⑧">4.2. XRTransientInputHitTestResult</a>
    <li><a href="#ref-for-enumdef-xrhittesttrackabletype⑨">9.2. Native entity type</a> <a href="#ref-for-enumdef-xrhittesttrackabletype①⓪">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrhittesttrackabletype-point">
   <b><a href="#dom-xrhittesttrackabletype-point">#dom-xrhittesttrackabletype-point</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrhittesttrackabletype-point">2.1. XRHitTestTrackableType</a>
    <li><a href="#ref-for-dom-xrhittesttrackabletype-point①">9.2. Native entity type</a> <a href="#ref-for-dom-xrhittesttrackabletype-point②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrhittesttrackabletype-plane">
   <b><a href="#dom-xrhittesttrackabletype-plane">#dom-xrhittesttrackabletype-plane</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrhittesttrackabletype-plane">2.1. XRHitTestTrackableType</a>
    <li><a href="#ref-for-dom-xrhittesttrackabletype-plane①">2.2. XRHitTestOptionsInit</a>
    <li><a href="#ref-for-dom-xrhittesttrackabletype-plane②">2.3. XRTransientInputHitTestOptionsInit</a>
    <li><a href="#ref-for-dom-xrhittesttrackabletype-plane③">9.2. Native entity type</a> <a href="#ref-for-dom-xrhittesttrackabletype-plane④">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrhittesttrackabletype-mesh">
   <b><a href="#dom-xrhittesttrackabletype-mesh">#dom-xrhittesttrackabletype-mesh</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrhittesttrackabletype-mesh">2.1. XRHitTestTrackableType</a>
    <li><a href="#ref-for-dom-xrhittesttrackabletype-mesh①">9.2. Native entity type</a> <a href="#ref-for-dom-xrhittesttrackabletype-mesh②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-xrhittestoptionsinit">
   <b><a href="#dictdef-xrhittestoptionsinit">#dictdef-xrhittestoptionsinit</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-xrhittestoptionsinit">2.2. XRHitTestOptionsInit</a> <a href="#ref-for-dictdef-xrhittestoptionsinit①">(2)</a> <a href="#ref-for-dictdef-xrhittestoptionsinit②">(3)</a>
    <li><a href="#ref-for-dictdef-xrhittestoptionsinit③">5. Requesting hit test</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrhittestoptionsinit-space">
   <b><a href="#dom-xrhittestoptionsinit-space">#dom-xrhittestoptionsinit-space</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrhittestoptionsinit-space">2.2. XRHitTestOptionsInit</a> <a href="#ref-for-dom-xrhittestoptionsinit-space①">(2)</a>
    <li><a href="#ref-for-dom-xrhittestoptionsinit-space②">5. Requesting hit test</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrhittestoptionsinit-entitytypes">
   <b><a href="#dom-xrhittestoptionsinit-entitytypes">#dom-xrhittestoptionsinit-entitytypes</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrhittestoptionsinit-entitytypes">2.2. XRHitTestOptionsInit</a> <a href="#ref-for-dom-xrhittestoptionsinit-entitytypes①">(2)</a> <a href="#ref-for-dom-xrhittestoptionsinit-entitytypes②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrhittestoptionsinit-offsetray">
   <b><a href="#dom-xrhittestoptionsinit-offsetray">#dom-xrhittestoptionsinit-offsetray</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrhittestoptionsinit-offsetray">2.2. XRHitTestOptionsInit</a> <a href="#ref-for-dom-xrhittestoptionsinit-offsetray①">(2)</a> <a href="#ref-for-dom-xrhittestoptionsinit-offsetray②">(3)</a> <a href="#ref-for-dom-xrhittestoptionsinit-offsetray③">(4)</a> <a href="#ref-for-dom-xrhittestoptionsinit-offsetray④">(5)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrhittestoptionsinit-effective-entitytypes">
   <b><a href="#xrhittestoptionsinit-effective-entitytypes">#xrhittestoptionsinit-effective-entitytypes</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrhittestoptionsinit-effective-entitytypes">2.2. XRHitTestOptionsInit</a>
    <li><a href="#ref-for-xrhittestoptionsinit-effective-entitytypes①">5. Requesting hit test</a> <a href="#ref-for-xrhittestoptionsinit-effective-entitytypes②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrhittestoptionsinit-effective-offsetray">
   <b><a href="#xrhittestoptionsinit-effective-offsetray">#xrhittestoptionsinit-effective-offsetray</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrhittestoptionsinit-effective-offsetray">2.2. XRHitTestOptionsInit</a>
    <li><a href="#ref-for-xrhittestoptionsinit-effective-offsetray①">5. Requesting hit test</a> <a href="#ref-for-xrhittestoptionsinit-effective-offsetray②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-xrtransientinputhittestoptionsinit">
   <b><a href="#dictdef-xrtransientinputhittestoptionsinit">#dictdef-xrtransientinputhittestoptionsinit</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-xrtransientinputhittestoptionsinit">2.3. XRTransientInputHitTestOptionsInit</a> <a href="#ref-for-dictdef-xrtransientinputhittestoptionsinit①">(2)</a> <a href="#ref-for-dictdef-xrtransientinputhittestoptionsinit②">(3)</a>
    <li><a href="#ref-for-dictdef-xrtransientinputhittestoptionsinit③">5. Requesting hit test</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrtransientinputhittestoptionsinit-profile">
   <b><a href="#dom-xrtransientinputhittestoptionsinit-profile">#dom-xrtransientinputhittestoptionsinit-profile</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrtransientinputhittestoptionsinit-profile">2.3. XRTransientInputHitTestOptionsInit</a> <a href="#ref-for-dom-xrtransientinputhittestoptionsinit-profile①">(2)</a>
    <li><a href="#ref-for-dom-xrtransientinputhittestoptionsinit-profile②">5. Requesting hit test</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrtransientinputhittestoptionsinit-entitytypes">
   <b><a href="#dom-xrtransientinputhittestoptionsinit-entitytypes">#dom-xrtransientinputhittestoptionsinit-entitytypes</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrtransientinputhittestoptionsinit-entitytypes">2.3. XRTransientInputHitTestOptionsInit</a> <a href="#ref-for-dom-xrtransientinputhittestoptionsinit-entitytypes①">(2)</a> <a href="#ref-for-dom-xrtransientinputhittestoptionsinit-entitytypes②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrtransientinputhittestoptionsinit-offsetray">
   <b><a href="#dom-xrtransientinputhittestoptionsinit-offsetray">#dom-xrtransientinputhittestoptionsinit-offsetray</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrtransientinputhittestoptionsinit-offsetray">2.3. XRTransientInputHitTestOptionsInit</a> <a href="#ref-for-dom-xrtransientinputhittestoptionsinit-offsetray①">(2)</a> <a href="#ref-for-dom-xrtransientinputhittestoptionsinit-offsetray②">(3)</a> <a href="#ref-for-dom-xrtransientinputhittestoptionsinit-offsetray③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrtransientinputhittestoptionsinit-effective-entitytypes">
   <b><a href="#xrtransientinputhittestoptionsinit-effective-entitytypes">#xrtransientinputhittestoptionsinit-effective-entitytypes</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrtransientinputhittestoptionsinit-effective-entitytypes">2.3. XRTransientInputHitTestOptionsInit</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrtransientinputhittestoptionsinit-effective-offsetray">
   <b><a href="#xrtransientinputhittestoptionsinit-effective-offsetray">#xrtransientinputhittestoptionsinit-effective-offsetray</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrtransientinputhittestoptionsinit-effective-offsetray">2.3. XRTransientInputHitTestOptionsInit</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrhittestsource">
   <b><a href="#xrhittestsource">#xrhittestsource</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrhittestsource">3.1. XRHitTestSource</a> <a href="#ref-for-xrhittestsource①">(2)</a> <a href="#ref-for-xrhittestsource②">(3)</a> <a href="#ref-for-xrhittestsource③">(4)</a> <a href="#ref-for-xrhittestsource④">(5)</a> <a href="#ref-for-xrhittestsource⑤">(6)</a> <a href="#ref-for-xrhittestsource⑥">(7)</a> <a href="#ref-for-xrhittestsource⑦">(8)</a> <a href="#ref-for-xrhittestsource⑧">(9)</a>
    <li><a href="#ref-for-xrhittestsource⑨">5. Requesting hit test</a>
    <li><a href="#ref-for-xrhittestsource①⓪">7. Obtaining hit test results</a> <a href="#ref-for-xrhittestsource①①">(2)</a> <a href="#ref-for-xrhittestsource①②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrhittestsource-session">
   <b><a href="#xrhittestsource-session">#xrhittestsource-session</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrhittestsource-session">3.1. XRHitTestSource</a> <a href="#ref-for-xrhittestsource-session①">(2)</a> <a href="#ref-for-xrhittestsource-session②">(3)</a>
    <li><a href="#ref-for-xrhittestsource-session③">3.2. XRTransientInputHitTestSource</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrhittestsource-native-origin">
   <b><a href="#xrhittestsource-native-origin">#xrhittestsource-native-origin</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrhittestsource-native-origin">3.1. XRHitTestSource</a>
    <li><a href="#ref-for-xrhittestsource-native-origin①">6. Computing hit test results</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrhittestsource-entity-types">
   <b><a href="#xrhittestsource-entity-types">#xrhittestsource-entity-types</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrhittestsource-entity-types">3.1. XRHitTestSource</a>
    <li><a href="#ref-for-xrhittestsource-entity-types①">6. Computing hit test results</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrhittestsource-offset-ray">
   <b><a href="#xrhittestsource-offset-ray">#xrhittestsource-offset-ray</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrhittestsource-offset-ray">3.1. XRHitTestSource</a>
    <li><a href="#ref-for-xrhittestsource-offset-ray①">6. Computing hit test results</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrhittestsource-active">
   <b><a href="#xrhittestsource-active">#xrhittestsource-active</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrhittestsource-active">3.1. XRHitTestSource</a> <a href="#ref-for-xrhittestsource-active①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="create-a-hit-test-source">
   <b><a href="#create-a-hit-test-source">#create-a-hit-test-source</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-create-a-hit-test-source">5. Requesting hit test</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrhittestsource-cancel">
   <b><a href="#dom-xrhittestsource-cancel">#dom-xrhittestsource-cancel</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrhittestsource-cancel">3.1. XRHitTestSource</a> <a href="#ref-for-dom-xrhittestsource-cancel①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cancel-a-hit-test-source">
   <b><a href="#cancel-a-hit-test-source">#cancel-a-hit-test-source</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cancel-a-hit-test-source">3.1. XRHitTestSource</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrtransientinputhittestsource">
   <b><a href="#xrtransientinputhittestsource">#xrtransientinputhittestsource</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrtransientinputhittestsource">3.2. XRTransientInputHitTestSource</a> <a href="#ref-for-xrtransientinputhittestsource①">(2)</a> <a href="#ref-for-xrtransientinputhittestsource②">(3)</a> <a href="#ref-for-xrtransientinputhittestsource③">(4)</a> <a href="#ref-for-xrtransientinputhittestsource④">(5)</a> <a href="#ref-for-xrtransientinputhittestsource⑤">(6)</a> <a href="#ref-for-xrtransientinputhittestsource⑥">(7)</a> <a href="#ref-for-xrtransientinputhittestsource⑦">(8)</a> <a href="#ref-for-xrtransientinputhittestsource⑧">(9)</a>
    <li><a href="#ref-for-xrtransientinputhittestsource⑨">5. Requesting hit test</a>
    <li><a href="#ref-for-xrtransientinputhittestsource①⓪">7. Obtaining hit test results</a> <a href="#ref-for-xrtransientinputhittestsource①①">(2)</a> <a href="#ref-for-xrtransientinputhittestsource①②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrtransientinputhittestsource-session">
   <b><a href="#xrtransientinputhittestsource-session">#xrtransientinputhittestsource-session</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrtransientinputhittestsource-session">3.2. XRTransientInputHitTestSource</a> <a href="#ref-for-xrtransientinputhittestsource-session①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrtransientinputhittestsource-profile">
   <b><a href="#xrtransientinputhittestsource-profile">#xrtransientinputhittestsource-profile</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrtransientinputhittestsource-profile">3.2. XRTransientInputHitTestSource</a>
    <li><a href="#ref-for-xrtransientinputhittestsource-profile①">6. Computing hit test results</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrtransientinputhittestsource-entity-types">
   <b><a href="#xrtransientinputhittestsource-entity-types">#xrtransientinputhittestsource-entity-types</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrtransientinputhittestsource-entity-types">3.2. XRTransientInputHitTestSource</a>
    <li><a href="#ref-for-xrtransientinputhittestsource-entity-types①">6. Computing hit test results</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrtransientinputhittestsource-offset-ray">
   <b><a href="#xrtransientinputhittestsource-offset-ray">#xrtransientinputhittestsource-offset-ray</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrtransientinputhittestsource-offset-ray">3.2. XRTransientInputHitTestSource</a>
    <li><a href="#ref-for-xrtransientinputhittestsource-offset-ray①">6. Computing hit test results</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrtransientinputhittestsource-active">
   <b><a href="#xrtransientinputhittestsource-active">#xrtransientinputhittestsource-active</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrtransientinputhittestsource-active">3.2. XRTransientInputHitTestSource</a> <a href="#ref-for-xrtransientinputhittestsource-active①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="create-a-hit-test-source-for-transient-input">
   <b><a href="#create-a-hit-test-source-for-transient-input">#create-a-hit-test-source-for-transient-input</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-create-a-hit-test-source-for-transient-input">5. Requesting hit test</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrtransientinputhittestsource-cancel">
   <b><a href="#dom-xrtransientinputhittestsource-cancel">#dom-xrtransientinputhittestsource-cancel</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrtransientinputhittestsource-cancel">3.2. XRTransientInputHitTestSource</a> <a href="#ref-for-dom-xrtransientinputhittestsource-cancel①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cancel-a-hit-test-source-for-transient-input">
   <b><a href="#cancel-a-hit-test-source-for-transient-input">#cancel-a-hit-test-source-for-transient-input</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cancel-a-hit-test-source-for-transient-input">3.2. XRTransientInputHitTestSource</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrhittestresult">
   <b><a href="#xrhittestresult">#xrhittestresult</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrhittestresult">4.1. XRHitTestResult</a> <a href="#ref-for-xrhittestresult①">(2)</a> <a href="#ref-for-xrhittestresult②">(3)</a> <a href="#ref-for-xrhittestresult③">(4)</a> <a href="#ref-for-xrhittestresult④">(5)</a>
    <li><a href="#ref-for-xrhittestresult⑤">4.2. XRTransientInputHitTestResult</a> <a href="#ref-for-xrhittestresult⑥">(2)</a> <a href="#ref-for-xrhittestresult⑦">(3)</a>
    <li><a href="#ref-for-xrhittestresult⑧">7. Obtaining hit test results</a> <a href="#ref-for-xrhittestresult⑨">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrhittestresult-frame">
   <b><a href="#xrhittestresult-frame">#xrhittestresult-frame</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrhittestresult-frame">4.1. XRHitTestResult</a> <a href="#ref-for-xrhittestresult-frame①">(2)</a> <a href="#ref-for-xrhittestresult-frame②">(3)</a> <a href="#ref-for-xrhittestresult-frame③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrhittestresult-native-origin">
   <b><a href="#xrhittestresult-native-origin">#xrhittestresult-native-origin</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrhittestresult-native-origin">4.1. XRHitTestResult</a> <a href="#ref-for-xrhittestresult-native-origin①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="create-a-hit-test-result">
   <b><a href="#create-a-hit-test-result">#create-a-hit-test-result</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-create-a-hit-test-result">4.2. XRTransientInputHitTestResult</a>
    <li><a href="#ref-for-create-a-hit-test-result①">6. Computing hit test results</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrhittestresult-getpose">
   <b><a href="#dom-xrhittestresult-getpose">#dom-xrhittestresult-getpose</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrhittestresult-getpose">4.1. XRHitTestResult</a> <a href="#ref-for-dom-xrhittestresult-getpose①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrtransientinputhittestresult">
   <b><a href="#xrtransientinputhittestresult">#xrtransientinputhittestresult</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrtransientinputhittestresult">4.2. XRTransientInputHitTestResult</a> <a href="#ref-for-xrtransientinputhittestresult①">(2)</a> <a href="#ref-for-xrtransientinputhittestresult②">(3)</a>
    <li><a href="#ref-for-xrtransientinputhittestresult③">7. Obtaining hit test results</a> <a href="#ref-for-xrtransientinputhittestresult④">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrtransientinputhittestresult-inputsource">
   <b><a href="#dom-xrtransientinputhittestresult-inputsource">#dom-xrtransientinputhittestresult-inputsource</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrtransientinputhittestresult-inputsource">4.2. XRTransientInputHitTestResult</a> <a href="#ref-for-dom-xrtransientinputhittestresult-inputsource①">(2)</a> <a href="#ref-for-dom-xrtransientinputhittestresult-inputsource②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrtransientinputhittestresult-results">
   <b><a href="#dom-xrtransientinputhittestresult-results">#dom-xrtransientinputhittestresult-results</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrtransientinputhittestresult-results">4.2. XRTransientInputHitTestResult</a> <a href="#ref-for-dom-xrtransientinputhittestresult-results①">(2)</a> <a href="#ref-for-dom-xrtransientinputhittestresult-results②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrtransientinputhittestresult-frame">
   <b><a href="#xrtransientinputhittestresult-frame">#xrtransientinputhittestresult-frame</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrtransientinputhittestresult-frame">4.2. XRTransientInputHitTestResult</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="create-a-hit-test-result-for-transient-input">
   <b><a href="#create-a-hit-test-result-for-transient-input">#create-a-hit-test-result-for-transient-input</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-create-a-hit-test-result-for-transient-input">6. Computing hit test results</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrsession-set-of-active-hit-test-sources">
   <b><a href="#xrsession-set-of-active-hit-test-sources">#xrsession-set-of-active-hit-test-sources</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrsession-set-of-active-hit-test-sources">3.1. XRHitTestSource</a> <a href="#ref-for-xrsession-set-of-active-hit-test-sources①">(2)</a>
    <li><a href="#ref-for-xrsession-set-of-active-hit-test-sources②">5. Requesting hit test</a>
    <li><a href="#ref-for-xrsession-set-of-active-hit-test-sources③">6. Computing hit test results</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrsession-set-of-active-hit-test-sources-for-transient-input">
   <b><a href="#xrsession-set-of-active-hit-test-sources-for-transient-input">#xrsession-set-of-active-hit-test-sources-for-transient-input</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrsession-set-of-active-hit-test-sources-for-transient-input">3.2. XRTransientInputHitTestSource</a> <a href="#ref-for-xrsession-set-of-active-hit-test-sources-for-transient-input①">(2)</a>
    <li><a href="#ref-for-xrsession-set-of-active-hit-test-sources-for-transient-input②">5. Requesting hit test</a>
    <li><a href="#ref-for-xrsession-set-of-active-hit-test-sources-for-transient-input③">6. Computing hit test results</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="request-hit-test">
   <b><a href="#request-hit-test">#request-hit-test</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-request-hit-test">3.1. XRHitTestSource</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrsession-requesthittestsource">
   <b><a href="#dom-xrsession-requesthittestsource">#dom-xrsession-requesthittestsource</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrsession-requesthittestsource">5. Requesting hit test</a> <a href="#ref-for-dom-xrsession-requesthittestsource①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrsession-requesthittestsourcefortransientinput">
   <b><a href="#dom-xrsession-requesthittestsourcefortransientinput">#dom-xrsession-requesthittestsourcefortransientinput</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrsession-requesthittestsourcefortransientinput">5. Requesting hit test</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="compute-all-hit-test-results">
   <b><a href="#compute-all-hit-test-results">#compute-all-hit-test-results</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-compute-all-hit-test-results">5. Requesting hit test</a> <a href="#ref-for-compute-all-hit-test-results①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="compute-hit-test-results">
   <b><a href="#compute-hit-test-results">#compute-hit-test-results</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-compute-hit-test-results">6. Computing hit test results</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="compute-hit-test-results-for-transient-input">
   <b><a href="#compute-hit-test-results-for-transient-input">#compute-hit-test-results-for-transient-input</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-compute-hit-test-results-for-transient-input">6. Computing hit test results</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrframe-map-of-hit-test-sources-to-hit-test-results">
   <b><a href="#xrframe-map-of-hit-test-sources-to-hit-test-results">#xrframe-map-of-hit-test-sources-to-hit-test-results</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrframe-map-of-hit-test-sources-to-hit-test-results">6. Computing hit test results</a>
    <li><a href="#ref-for-xrframe-map-of-hit-test-sources-to-hit-test-results①">7. Obtaining hit test results</a> <a href="#ref-for-xrframe-map-of-hit-test-sources-to-hit-test-results②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrframe-map-of-hit-test-sources-to-hit-test-results-for-transient-input">
   <b><a href="#xrframe-map-of-hit-test-sources-to-hit-test-results-for-transient-input">#xrframe-map-of-hit-test-sources-to-hit-test-results-for-transient-input</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrframe-map-of-hit-test-sources-to-hit-test-results-for-transient-input">6. Computing hit test results</a>
    <li><a href="#ref-for-xrframe-map-of-hit-test-sources-to-hit-test-results-for-transient-input①">7. Obtaining hit test results</a> <a href="#ref-for-xrframe-map-of-hit-test-sources-to-hit-test-results-for-transient-input②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrframe-gethittestresults">
   <b><a href="#dom-xrframe-gethittestresults">#dom-xrframe-gethittestresults</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrframe-gethittestresults">7. Obtaining hit test results</a> <a href="#ref-for-dom-xrframe-gethittestresults①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrframe-gethittestresultsfortransientinput">
   <b><a href="#dom-xrframe-gethittestresultsfortransientinput">#dom-xrframe-gethittestresultsfortransientinput</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrframe-gethittestresultsfortransientinput">7. Obtaining hit test results</a> <a href="#ref-for-dom-xrframe-gethittestresultsfortransientinput①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrray-matrix">
   <b><a href="#xrray-matrix">#xrray-matrix</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrray-matrix">8.1. XRRay</a> <a href="#ref-for-xrray-matrix①">(2)</a> <a href="#ref-for-xrray-matrix②">(3)</a> <a href="#ref-for-xrray-matrix③">(4)</a> <a href="#ref-for-xrray-matrix④">(5)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrray">
   <b><a href="#xrray">#xrray</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrray">2.2. XRHitTestOptionsInit</a> <a href="#ref-for-xrray①">(2)</a> <a href="#ref-for-xrray②">(3)</a>
    <li><a href="#ref-for-xrray③">2.3. XRTransientInputHitTestOptionsInit</a> <a href="#ref-for-xrray④">(2)</a> <a href="#ref-for-xrray⑤">(3)</a>
    <li><a href="#ref-for-xrray⑥">3.1. XRHitTestSource</a>
    <li><a href="#ref-for-xrray⑦">3.2. XRTransientInputHitTestSource</a>
    <li><a href="#ref-for-xrray⑧">8.1. XRRay</a> <a href="#ref-for-xrray⑨">(2)</a> <a href="#ref-for-xrray①⓪">(3)</a> <a href="#ref-for-xrray①①">(4)</a> <a href="#ref-for-xrray①②">(5)</a> <a href="#ref-for-xrray①③">(6)</a> <a href="#ref-for-xrray①④">(7)</a> <a href="#ref-for-xrray①⑤">(8)</a> <a href="#ref-for-xrray①⑥">(9)</a> <a href="#ref-for-xrray①⑦">(10)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrray-xrray">
   <b><a href="#dom-xrray-xrray">#dom-xrray-xrray</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrray-xrray">2.2. XRHitTestOptionsInit</a>
    <li><a href="#ref-for-dom-xrray-xrray①">2.3. XRTransientInputHitTestOptionsInit</a>
    <li><a href="#ref-for-dom-xrray-xrray②">8.1. XRRay</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrray-xrray-transform">
   <b><a href="#dom-xrray-xrray-transform">#dom-xrray-xrray-transform</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrray-xrray-transform">8.1. XRRay</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrray-origin">
   <b><a href="#dom-xrray-origin">#dom-xrray-origin</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrray-origin">8.1. XRRay</a> <a href="#ref-for-dom-xrray-origin①">(2)</a> <a href="#ref-for-dom-xrray-origin②">(3)</a> <a href="#ref-for-dom-xrray-origin③">(4)</a> <a href="#ref-for-dom-xrray-origin④">(5)</a> <a href="#ref-for-dom-xrray-origin⑤">(6)</a> <a href="#ref-for-dom-xrray-origin⑥">(7)</a> <a href="#ref-for-dom-xrray-origin⑦">(8)</a> <a href="#ref-for-dom-xrray-origin⑧">(9)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrray-direction">
   <b><a href="#dom-xrray-direction">#dom-xrray-direction</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrray-direction">8.1. XRRay</a> <a href="#ref-for-dom-xrray-direction①">(2)</a> <a href="#ref-for-dom-xrray-direction②">(3)</a> <a href="#ref-for-dom-xrray-direction③">(4)</a> <a href="#ref-for-dom-xrray-direction④">(5)</a> <a href="#ref-for-dom-xrray-direction⑤">(6)</a> <a href="#ref-for-dom-xrray-direction⑥">(7)</a> <a href="#ref-for-dom-xrray-direction⑦">(8)</a> <a href="#ref-for-dom-xrray-direction⑧">(9)</a> <a href="#ref-for-dom-xrray-direction⑨">(10)</a> <a href="#ref-for-dom-xrray-direction①⓪">(11)</a> <a href="#ref-for-dom-xrray-direction①①">(12)</a> <a href="#ref-for-dom-xrray-direction①②">(13)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-xrray-matrix">
   <b><a href="#dom-xrray-matrix">#dom-xrray-matrix</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-xrray-matrix">8.1. XRRay</a> <a href="#ref-for-dom-xrray-matrix①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="xrray-obtain-the-matrix">
   <b><a href="#xrray-obtain-the-matrix">#xrray-obtain-the-matrix</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-xrray-obtain-the-matrix">8.1. XRRay</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="distance-along-the-ray">
   <b><a href="#distance-along-the-ray">#distance-along-the-ray</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-distance-along-the-ray">6. Computing hit test results</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="native-hit-test">
   <b><a href="#native-hit-test">#native-hit-test</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-native-hit-test">6. Computing hit test results</a> <a href="#ref-for-native-hit-test①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="native-entity-type">
   <b><a href="#native-entity-type">#native-entity-type</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-native-entity-type">4.1. XRHitTestResult</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="convert-from-native-entity-type">
   <b><a href="#convert-from-native-entity-type">#convert-from-native-entity-type</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-convert-from-native-entity-type">4.1. XRHitTestResult</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="native-hit-test-result">
   <b><a href="#native-hit-test-result">#native-hit-test-result</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-native-hit-test-result">4.1. XRHitTestResult</a>
    <li><a href="#ref-for-native-hit-test-result①">4.2. XRTransientInputHitTestResult</a>
    <li><a href="#ref-for-native-hit-test-result②">6. Computing hit test results</a> <a href="#ref-for-native-hit-test-result③">(2)</a>
    <li><a href="#ref-for-native-hit-test-result④">9.2. Native entity type</a>
    <li><a href="#ref-for-native-hit-test-result⑤">9.3. Native hit test result</a>
   </ul>
  </aside>
<script>/* script-var-click-highlighting */

    document.addEventListener("click", e=>{
        if(e.target.nodeName == "VAR") {
            highlightSameAlgoVars(e.target);
        }
    });
    {
        const indexCounts = new Map();
        const indexNames = new Map();
        function highlightSameAlgoVars(v) {
            // Find the algorithm container.
            let algoContainer = null;
            let searchEl = v;
            while(algoContainer == null && searchEl != document.body) {
                searchEl = searchEl.parentNode;
                if(searchEl.hasAttribute("data-algorithm")) {
                    algoContainer = searchEl;
                }
            }

            // Not highlighting document-global vars,
            // too likely to be unrelated.
            if(algoContainer == null) return;

            const algoName = algoContainer.getAttribute("data-algorithm");
            const varName = getVarName(v);
            const addClass = !v.classList.contains("selected");
            let highlightClass = null;
            if(addClass) {
                const index = chooseHighlightIndex(algoName, varName);
                indexCounts.get(algoName)[index] += 1;
                indexNames.set(algoName+"///"+varName, index);
                highlightClass = nameFromIndex(index);
            } else {
                const index = previousHighlightIndex(algoName, varName);
                indexCounts.get(algoName)[index] -= 1;
                highlightClass = nameFromIndex(index);
            }

            // Find all same-name vars, and toggle their class appropriately.
            for(const el of algoContainer.querySelectorAll("var")) {
                if(getVarName(el) == varName) {
                    el.classList.toggle("selected", addClass);
                    el.classList.toggle(highlightClass, addClass);
                }
            }
        }
        function getVarName(el) {
            return el.textContent.replace(/(\s| )+/, " ").trim();
        }
        function chooseHighlightIndex(algoName, varName) {
            let indexes = null;
            if(indexCounts.has(algoName)) {
                indexes = indexCounts.get(algoName);
            } else {
                // 7 classes right now
                indexes = [0,0,0,0,0,0,0];
                indexCounts.set(algoName, indexes);
            }

            // If the element was recently unclicked,
            // *and* that color is still unclaimed,
            // give it back the same color.
            const lastIndex = previousHighlightIndex(algoName, varName);
            if(indexes[lastIndex] === 0) return lastIndex;

            // Find the earliest index with the lowest count.
            const minCount = Math.min.apply(null, indexes);
            let index = null;
            for(var i = 0; i < indexes.length; i++) {
                if(indexes[i] == minCount) {
                    return i;
                }
            }
        }
        function previousHighlightIndex(algoName, varName) {
            return indexNames.get(algoName+"///"+varName);
        }
        function nameFromIndex(index) {
            return "selected" + index;
        }
    }
    </script>
<script>/* script-dfn-panel */

document.body.addEventListener("click", function(e) {
    var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); }
    // Find the dfn element or panel, if any, that was clicked on.
    var el = e.target;
    var target;
    var hitALink = false;
    while(el.parentElement) {
        if(el.tagName == "A") {
            // Clicking on a link in a <dfn> shouldn't summon the panel
            hitALink = true;
        }
        if(el.classList.contains("dfn-paneled")) {
            target = "dfn";
            break;
        }
        if(el.classList.contains("dfn-panel")) {
            target = "dfn-panel";
            break;
        }
        el = el.parentElement;
    }
    if(target != "dfn-panel") {
        // Turn off any currently "on" or "activated" panels.
        queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(function(el){
            el.classList.remove("on");
            el.classList.remove("activated");
        });
    }
    if(target == "dfn" && !hitALink) {
        // open the panel
        var dfnPanel = document.querySelector(".dfn-panel[data-for='" + el.id + "']");
        if(dfnPanel) {
            dfnPanel.classList.add("on");
            var rect = el.getBoundingClientRect();
            dfnPanel.style.left = window.scrollX + rect.right + 5 + "px";
            dfnPanel.style.top = window.scrollY + rect.top + "px";
            var panelRect = dfnPanel.getBoundingClientRect();
            var panelWidth = panelRect.right - panelRect.left;
            if(panelRect.right > document.body.scrollWidth && (rect.left - (panelWidth + 5)) > 0) {
                // Reposition, because the panel is overflowing
                dfnPanel.style.left = window.scrollX + rect.left - (panelWidth + 5) + "px";
            }
        } else {
            console.log("Couldn't find .dfn-panel[data-for='" + el.id + "']");
        }
    } else if(target == "dfn-panel") {
        // Switch it to "activated" state, which pins it.
        el.classList.add("activated");
        el.style.left = null;
        el.style.top = null;
    }

});
</script>